I have an application which listens to a port. I have no problem connecting to it. When I close the application the address is free for use again. In one case the address is in use - it's when I have started a process (system.diagnostics) somewhere in the application and that process is still running. When I have done so, the tcplistener is not shutdown properly and the address is taken.
How can I force a shutdown of the tcplistener? Right now I am doing this but it does not help:
If Not listener Is Nothing Then
listener.Server.Close()
listener.Stop()
End If
How can I force a shutdown of the tcplistener? Right now I am doing this but it does not help:
If Not listener Is Nothing Then
listener.Server.Close()
listener.Stop()
End If