I have a server Application that takes connections on Port X lets say.

When I am terminating the Application I am executing the following code :



Code:
 


       Winsock1(0).Close
and I am looping waiting for the winsock to close

WHen I try to run the application Again. It always gives me the error Port in USe....

I have to restart for it to clear the port ... Any ideas How I can explicitely free the Port I am connecting to ?