ankur_ 24 Light Poster

I am running a program(client) that creates about 20000 sockets.
After closing this exe when I again want to run than some of the sockets still remain alive and are not closed.
Is there any mechanism that I can close these socket just after my exe terminates.

I am using non-blocking sockets.