tags:

views:

57

answers:

1
+2  Q: 

C# Sockets Quesion

In UDP client after executing:

    socket.SendTo(data, SendIP);

Why does socket.LocalEndPoint change?

+3  A: 

If you never called socket.Bind, then on the first transmission the UDP stack will automatically assign you a local address.

Quote from MSDN:

If you are using a connectionless protocol, you do not need to establish a default remote host with the Connect method prior to calling SendTo. ... .You are also not required to call the Bind method, because the underlying service provider will assign the most appropriate local network address and port number.

qbeuek