Click here to Skip to main content
15,903,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing Generic List to other forms Pin
Kendall Bodkin15-Nov-11 10:24
Kendall Bodkin15-Nov-11 10:24 
QuestionNext Linq Question Pin
Kevin Marois14-Nov-11 12:44
professionalKevin Marois14-Nov-11 12:44 
AnswerRe: Next Linq Question Pin
BobJanova15-Nov-11 1:00
BobJanova15-Nov-11 1:00 
AnswerRe: Next Linq Question Pin
NeillJam17-Nov-11 22:50
NeillJam17-Nov-11 22:50 
QuestionLinq To Objects - How To Create Nested Objects Pin
Kevin Marois14-Nov-11 12:18
professionalKevin Marois14-Nov-11 12:18 
AnswerRe: Linq To Objects - How To Create Nested Objects Pin
BillWoodruff14-Nov-11 21:52
professionalBillWoodruff14-Nov-11 21:52 
QuestionConvert XslTransform to XslCompiledTransform Pin
Melanie Peterson14-Nov-11 6:22
Melanie Peterson14-Nov-11 6:22 
QuestionUDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 3:58
Alberto Bar-Noy14-Nov-11 3:58 
Give me the codezzzzzzzzz Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P Poke tongue | ;-P

No no seriously now I have a piece of code that joins a group, sends data and awaits response.
I fore up Whireshark and see the data I send, I see the data that is being send back but I never get the data in my code.

Here is the code with
C#
UDPClient 
(which I copied from MS) and I also have code which I made with sockets and both behave the same way so I stick with the
UDPClient 
one

C#
    // This constructor arbitrarily assigns the local port number.
    UdpClient udpClient = new UdpClient("224.0.1.1", 3333);
    try
    {
  //      udpClient.Connect("224.0.1.1", 3333);

        // Sends a message to the host to which you have connected.

        MemoryStream ms = new MemoryStream();
        BinaryWriter bw = new BinaryWriter(ms);

        Int32 b = 0x01;
        bw.Write(b); //MsgOpCode = 0x01
        string str = "FF:FF:FF:FF:FF:FF";
        bw.Write(Encoding.ASCII.GetBytes(str.ToCharArray()));//mac
        bw.Write('\0');//-ip
        bw.Write('\0');//-mask

        byte[] byteArray = ms.GetBuffer();

        udpClient.Send(byteArray, byteArray.Length);

        // Sends a message to a different host using optional hostname and port parameters.

        //IPEndPoint object will allow us to read datagrams sent from any source.
        IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);

        // Blocks until a message returns on this socket from a remote host.
        Byte[] receiveBytes = udpClient.Receive(ref RemoteIpEndPoint);
        string returnData = Encoding.ASCII.GetString(receiveBytes);

        // Uses the IPEndPoint object to determine which of these two hosts responded.
        Console.WriteLine("This is the message you received " +
                                     returnData.ToString());
        Console.WriteLine("This message was sent from " +
                                    RemoteIpEndPoint.Address.ToString() +
                                    " on their port number " +
                                    RemoteIpEndPoint.Port.ToString());

        udpClient.Close();
    }
    catch (Exception e)
    {
        Console.WriteLine(e.ToString());
    }
}


Any insights on why I am not getting the data I requested (although I see it in wireshark?)

In case you ask I have been at it all day Sniff | :^) Sniff | :^)
Alberto Bar-Noy
---------------
“The city’s central computer told you? R2D2, you know better than to trust a strange computer!”
(C3PO)

AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Luc Pattyn14-Nov-11 4:45
sitebuilderLuc Pattyn14-Nov-11 4:45 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 4:49
Alberto Bar-Noy14-Nov-11 4:49 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Luc Pattyn14-Nov-11 5:14
sitebuilderLuc Pattyn14-Nov-11 5:14 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:25
Alberto Bar-Noy14-Nov-11 5:25 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Rob Philpott14-Nov-11 5:34
Rob Philpott14-Nov-11 5:34 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:36
Alberto Bar-Noy14-Nov-11 5:36 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Rob Philpott14-Nov-11 5:46
Rob Philpott14-Nov-11 5:46 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Luc Pattyn14-Nov-11 5:35
sitebuilderLuc Pattyn14-Nov-11 5:35 
GeneralRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:36
Alberto Bar-Noy14-Nov-11 5:36 
AnswerRe: UDP send /recieve problem... well mainly recieve Pin
Alberto Bar-Noy14-Nov-11 5:40
Alberto Bar-Noy14-Nov-11 5:40 
Questiondistribute stored procedure files Pin
Marcel Vreuls (www.agentbase.nl)14-Nov-11 2:30
Marcel Vreuls (www.agentbase.nl)14-Nov-11 2:30 
AnswerRe: distribute stored procedure files Pin
SilimSayo14-Nov-11 10:42
SilimSayo14-Nov-11 10:42 
QuestionMouse move (hover) over an Image with Graphics drawings Pin
eyalbi00714-Nov-11 2:12
eyalbi00714-Nov-11 2:12 
AnswerRe: Mouse move (hover) over an Image with Graphics drawings Pin
Luc Pattyn14-Nov-11 2:43
sitebuilderLuc Pattyn14-Nov-11 2:43 
QuestionClass for Serail Port Comms Pin
KeithF14-Nov-11 1:24
KeithF14-Nov-11 1:24 
AnswerRe: Class for Serail Port Comms Pin
Luc Pattyn14-Nov-11 1:48
sitebuilderLuc Pattyn14-Nov-11 1:48 
GeneralRe: Class for Serail Port Comms Pin
KeithF14-Nov-11 4:24
KeithF14-Nov-11 4:24 

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.