- I am supposed to connect to external server using UDP sockets in C#..
- I could not understand these 2 lines in server usage notes:
“Use of dedicated sockets is enforced.”
and
“If the server looses UDP connectivity with the client, it will …”
I thought that the UDP socket is connectionless!
So what did “looses connectivity” mean? and how to avoid it?
Does there is a known way to ensure “dedicated sockets”?
Thanks
To me this says, create one unique socket for each connection and use it throughout that connection.
EDIT: Just to expand on this, from the servers point of view.
That way the server can distinguish from which client each message came from. Because the remote address is made up of an ip address and port combination, you should use the same socket throughout your communication of the sever. This is because if you don’t, it’s possible you could get assigned a different port next time you change the underlying socket.
It is possible to loose UPD connectivity e.g. either of the endpoints in the connection is lost, say I go to the server and pull the plug?
EDIT2:
Dan Bryant makes an excellent point in the comments, that links in with what I was saying about.