Click here to Skip to main content
15,911,139 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Binding Source Refresh Problem Pin
Brij11-Dec-08 17:23
mentorBrij11-Dec-08 17:23 
AnswerRe: Binding Source Refresh Problem Pin
ShilpaGInode14-Dec-08 20:56
ShilpaGInode14-Dec-08 20:56 
QuestionMigrating UDP Broadcast code from a C++ program to C# Pin
jwangAimCo10-Dec-08 11:46
jwangAimCo10-Dec-08 11:46 
QuestionRe: Migrating UDP Broadcast code from a C++ program to C# Pin
led mike11-Dec-08 4:53
led mike11-Dec-08 4:53 
QuestionRe: Migrating UDP Broadcast code from a C++ program to C# Pin
jwangAimCo11-Dec-08 5:56
jwangAimCo11-Dec-08 5:56 
AnswerRe: Migrating UDP Broadcast code from a C++ program to C# Pin
led mike11-Dec-08 6:24
led mike11-Dec-08 6:24 
AnswerRe: Migrating UDP Broadcast code from a C++ program to C# Pin
Christian Graus11-Dec-08 15:00
protectorChristian Graus11-Dec-08 15:00 
AnswerRe: Migrating UDP Broadcast code from a C++ program to C# Pin
jwangAimCo17-Dec-08 8:36
jwangAimCo17-Dec-08 8:36 
I figured it out after messing with some Ethernet sniffers and other utilities. I'm posting the code for anyone else who may find this useful in the future.

private void FindBoards()
{
    ArrayList crArray = new ArrayList();
    byte[] sendData = new byte[1024];
    byte[] rcvData = new byte[1024];


    //Setting up Broadcast and Local Endpoint and socket protocol.
    Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
    s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
    IPEndPoint localEP = new IPEndPoint(IPAddress.Any, 20034);
    IPEndPoint broadcastEP = new IPEndPoint(IPAddress.Broadcast, 20034);

    try
    {
        sendData = "whatever you want to send";
        s.Bind(localEP);
        s.SendTo(sendData, broadcastEP);

        s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 2000);
    }
    catch (System.Net.Sockets.SocketException se)
    {
        MessageBox.Show(se.Message);
    }

    //Iterate on the Socket to find data
    try
    {
        int rcvSize;
        int crIndex = 0;
        DateTime rcvTimer = DateTime.Now.AddSeconds(1);
        do
        {
            rcvSize = s.Available;
            if (rcvSize > 0)
            {
                EndPoint local = (EndPoint)localEP;
                int iRX = s.ReceiveFrom(rcvData, 0, 1024, SocketFlags.None, ref local);
            }
        } while ((rcvSize > 0) || (DateTime.Now < rcvTimer));
    }
    catch (System.Net.Sockets.SocketException se)
    {
        MessageBox.Show(se.Message);
    }
    //Close socket
    s.Close();
}

QuestionCan't open Scramble Dictionary download Pin
David Kinsella10-Dec-08 8:00
David Kinsella10-Dec-08 8:00 
AnswerRe: Can't open Scramble Dictionary download Pin
Dave Kreskowiak10-Dec-08 11:00
mveDave Kreskowiak10-Dec-08 11:00 
GeneralRe: Can't open Scramble Dictionary download Pin
David Kinsella10-Dec-08 13:51
David Kinsella10-Dec-08 13:51 
GeneralRe: Can't open Scramble Dictionary download Pin
Dave Kreskowiak10-Dec-08 14:29
mveDave Kreskowiak10-Dec-08 14:29 
QuestionHow to fecth email attribues(subject,from,date etc.) from an .msg file Pin
gsdeepak10-Dec-08 1:48
gsdeepak10-Dec-08 1:48 
AnswerRe: How to fecth email attribues(subject,from,date etc.) from an .msg file Pin
Giorgi Dalakishvili10-Dec-08 2:43
mentorGiorgi Dalakishvili10-Dec-08 2:43 
QuestionVietnampathfinder Travel Pin
vntravel10-Dec-08 0:15
vntravel10-Dec-08 0:15 
QuestionFacing a problem to create a dyanmic event at runtime Pin
Member 29821779-Dec-08 21:26
Member 29821779-Dec-08 21:26 
AnswerRe: Facing a problem to create a dyanmic event at runtime Pin
PC Player11-Dec-08 10:14
PC Player11-Dec-08 10:14 
AnswerRe: Facing a problem to create a dyanmic event at runtime Pin
Dragonfly_Lee24-Dec-08 19:25
Dragonfly_Lee24-Dec-08 19:25 
QuestionFacing a problem while implementing Balloon Callout Using Asp.Net Ajax Tool Kit Pin
Rankee RK9-Dec-08 8:52
Rankee RK9-Dec-08 8:52 
AnswerRe: Facing a problem while implementing Balloon Callout Using Asp.Net Ajax Tool Kit Pin
Giorgi Dalakishvili9-Dec-08 8:56
mentorGiorgi Dalakishvili9-Dec-08 8:56 
Questionorder of execution of mark and compact algorithms Pin
mukkanti0079-Dec-08 0:25
mukkanti0079-Dec-08 0:25 
GeneralRe: order of execution of mark and compact algorithms Pin
Luc Pattyn9-Dec-08 0:42
sitebuilderLuc Pattyn9-Dec-08 0:42 
Questionhow to use IMessageFilter in cf Pin
Ola E8-Dec-08 9:44
Ola E8-Dec-08 9:44 
Question32- vs 64-bit - utility to tell which was used? Pin
dandy728-Dec-08 9:01
dandy728-Dec-08 9:01 
AnswerRe: 32- vs 64-bit - utility to tell which was used? Pin
Giorgi Dalakishvili8-Dec-08 9:14
mentorGiorgi Dalakishvili8-Dec-08 9:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.