I\'m binding a client TCP socket to a specific local port. To handle the situation where the socket remains in TIME_WAIT state for some time, I use
TIME_WAIT
You don't specify which Windows platform you're running on, that may affect things as may the security principal that you're running under (i.e. are you admin?)...
This may help: http://blogs.msdn.com/wndp/archive/2005/08/03/Anthony-Jones.aspx