listening for Dgrams. need to parse IP header?
-
I was wondering if you are creating a socket by using this code: Socket socket_ = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp); what sort of data will you receive? will you get only the UDP portion of the IP packet? or will you get all ip packets with the upperprotocol matching UDP on the port you specified in your IPEndPoint? I'm trying to figure out where i go next in my code. if i need to write code to parse out the udp datagram from the ip packet or the data from the udp datagram. thanks!
-
I was wondering if you are creating a socket by using this code: Socket socket_ = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp); what sort of data will you receive? will you get only the UDP portion of the IP packet? or will you get all ip packets with the upperprotocol matching UDP on the port you specified in your IPEndPoint? I'm trying to figure out where i go next in my code. if i need to write code to parse out the udp datagram from the ip packet or the data from the udp datagram. thanks!
nevermind. i used BytesReceived = so2.EndReceive(ar); System.Console.WriteLine("Bytes Received:" + BytesReceived); and then matched up that number with the data bytes field in the UDP packet in ethereal. i think i made the logical assumption that bytes received: 282 and the length of the data in the udp packet in ethereal is 282 that its one in the same..