I am currently in the process of debugging a server application which uses sockets to connect with clients. When I close the application, either gracefully which includes a socket.Close() or forcibly through visual studio or by terminating the process, the port remains bound and is still reported as listening, as confirmed by TCPView, netstat in command prompt, and AnVir Task Manager, all which show the port still bound to the one I chose, and indicate that it is still actively listening for connections. None of the tools I mentioned list a process associated with the connection.
Attempting to forcibly close the connection through TCPView, or AnVir, or any other tool does not have any effect. The only way I can unbind it is by logging off of windows entirely or restarting the PC.
How should I ensure that the port is unbound when my application exits? Shouldn't socket.Close() take care of this?