What is SocketOptionName.ReuseAddress used for?

Posted by Hemant on Stack Overflow See other posts from Stack Overflow or by Hemant
Published on 2010-05-04T08:51:34Z Indexed on 2010/05/04 9:08 UTC
Read the original article Hit count: 412

Filed under:
|
|
|

I used to think that using SocketOptionName.ReuseAddress, I can reuse a port that is in TIME_WAIT state. But I tried to experiment with it and it seems it has no effect.

If I check sockets using netstat, and it shows the socket is in TIME_WAIT state and I immediately run the client again, I get the exception:

Only one usage of each socket address (protocol/network address/port) is normally permitted 172.16.16.16:12345

I cannot make anything out of it. Please can you elaborate what SocketOptionName.ReuseAddress is good for?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about tcp