How can i make a functional latency measurements with sockets?

"However according to the TCP specification the OS have to keep the lower level tidbits of the socket open for a certain amount of time in order to detect retransmission, and similar. In this particular case it's likely keeping the socket around for a bit in order to detect a reply to the SYN packet sent so it can reply more sensibly and not mix up the reply with further packets sent."

"by default it will sit in the FIN_WAIT state for 4 minutes before Windows really closes it. Even more interesting is if you reopen the another connection to the same destination/port windows will reuse connections in FIN_WAIT that match"

Based on this making a something like a latency measurement would not work with sockets if you repeat it to get updates within a few seconds since it will continuously open sockets even if you do socket.close / socket.shutdown And then i end up with 200-300 sockets and rising..

Do anyone else know an alternative? ICMP / Ping is disabled so that is not really an option.

Thanks for any help at all..

by wildsushiroll via /r/csharp

Leave a Reply