MattNorman
Well-known member
- Joined
- May 22, 2021
- Messages
- 98
- Programming Experience
- 1-3
I am currently having issues whereby network ports stay in a listening state after I exit my application.
Currently I just have an exit button on the main window and shutdown all of the network elements as part of the command binding for that button.
On occasion, when re-loading the app I get network exceptions as the port I am trying to listen on is still in a listening state from the previous instance of the app.
Strangely, if I use command prompt to find the process ID and try to kill it, windows states that the process does not exist.
Is there a global event I can use to make sure my shutdown code is properly executed or a more consistent way to stop listening on ports?
I am using the old NetworkComms.Net library and this comes with built in methods to close all connections and shutdown all network elements.
Currently I just have an exit button on the main window and shutdown all of the network elements as part of the command binding for that button.
On occasion, when re-loading the app I get network exceptions as the port I am trying to listen on is still in a listening state from the previous instance of the app.
Strangely, if I use command prompt to find the process ID and try to kill it, windows states that the process does not exist.
Is there a global event I can use to make sure my shutdown code is properly executed or a more consistent way to stop listening on ports?
I am using the old NetworkComms.Net library and this comes with built in methods to close all connections and shutdown all network elements.