Well this is my first udp test program and i think i now understand a bit of it :) any way here is my code so far:
static void Main(string[] args)
{
Socket udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
udpSocket.Bind(new IPEndPoint(IPAddress.Any, 111));
Console.WriteLine("Waiting for connection");
byte[] buffer = new byte[1024*64];
int count = udpSocket.Receive(buffer);
IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 111);
EndPoint endPoint = (EndPoint)ipEndPoint;
udpSocket.ReceiveFrom(buffer, ref endPoint);
Console.WriteLine("Message recived from, " + endPoint.ToString() + " data length: " + count);
Console.ReadKey();
}
but how do i make sure that i got the whole packet?