Is there way to know precise time when packages arrives to buffer with UDP protocol in C# (windows 7)?
I tried somethings like this:
while(true) {
UDPclient.Receive(ref remoteEp);
Console.WriteLine(System.DateTime.Now.TimeOfDay.ToString()); }
I got wrong result. Some of packages arrive very close, some too far from each other. Wireshark gives correct timestamp, time between two packages are the same in my application. I also tried with the asynchronous BeginReceive operation, but I also got wrong timings between packages. I tried to increase thread priority in which I receive, but also didn't solve my problem.
I process packages really fast, so while loop is not too slow (I checked it).
Is there any way to know when packages arrive to buffer instead when are received from buffer?