Here is document about SO_EXCLUSIVEADDRUSE and SO_REUSEADDR. .NET socket
is a wrap for win32 socket.
In the case where the first bind sets no options or SO_REUSEADDR, and the
second bind performs a SO_REUSEADDR, the second socket has overtaken the
port and behavior regarding which socket will receive packets is
undetermined. SO_EXCLUSIVEADDRUSE was introduced to address this situation.
Use of the ReuseAddress has two concerns.
1. It may cause security issue, as the document above, if we set a socket
is not SO_EXCLUSIVEADDRUSE, so other low privilege app will set their
socket to listen on the same port.
2. As the document above, behavior regarding which socket will receive
packets is undetermined.
Since the winsock is an implement of BSD socket family, The SO_REUSEADDR is
used to compatible with the BSD socket.
Also for a common C/S app, the procedure should be as follows.
1. client send
2. server recv
3. server send
4. client recv.
So it is not necessary to do the resv and send in the mean time.
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.