If you close a program's front-end, Grapevine does not shutdown automatically. This leaves whatever port you were listening on open, and it's very difficult (if not impossible) to stop it without rebooting the entire machine.
You can accomplish this automatically by shutting down the server if the object is disposed. The object is disposed when the main thread is destroyed. Something like the following needs to be added to the server's constructor.
Private Sub Server_Close(sender As Object, e As EventArgs) Handles MyBase.Disposed
If svr IsNot Nothing AndAlso svr.IsListening Then svr.Stop()
End Sub
After some looking around, I am unable to find a way to do this that works. If you have a suggestion or working code, please post it here. Otherwise, I would recommend using the provided Dispose pattern.
If you close a program's front-end, Grapevine does not shutdown automatically. This leaves whatever port you were listening on open, and it's very difficult (if not impossible) to stop it without rebooting the entire machine.
You can accomplish this automatically by shutting down the server if the object is disposed. The object is disposed when the main thread is destroyed. Something like the following needs to be added to the server's constructor.