Socket Progamming in .NET

September 19, 2003

I am trying to write a simple tracert program in .net and have come across a problem. Assume that the rest of the packet data is correct.

I set the sockets TTL to 10 using the following code:

socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.IpTimeToLive, 10);

Then send data out of the socket using an Echo request, then receive data from the socket. Now effectively the ref EndPoint remoteEP should now be set to an end point matching the 10th hop on its route to the destination, instead it contains an end point matching the actual destination.

Anyone got any idea on this?