المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : socket not closing even after the listening app has terminated?!



C# Programming
08-04-2009, 04:03 PM
hi!
i have a very weird problem:
i have an app which listens for connections, and once a client connects it starts anothter app,
now if the main listening app terminates but app2 is still running then the port isnt released and when the main app starts up again and try to bind to the port it fails (port already in use).

the port is first released when app2 or all of its child processes has terminated, but these processes has nothing to with the main app, so why isnt port released after the main app has been terminated?