The problem I face is that after calling disconnect the client automatically connects to the server. Which causes "hung up" warning when closing the winform.
I'm testing the code with default server.js code downloaded from npm.
The winform code:
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Me.DisconnectFromServer()
End Sub
Sub DisconnectFromServer()
For Each scc As Socket In SCClientList
scc.Disconnect()
Next
End Sub
When this code is run, immediately after disconnection the socket reconnects causing 'Socket hung up' warning on the server after the form is closed.
I understand that I can dispose the client after disconnection.
This is only a test case, but in actual usage scenario I may disconnect from the server without closing the form. Suggest a solution or work around.
The problem I face is that after calling disconnect the client automatically connects to the server. Which causes "hung up" warning when closing the winform.
I'm testing the code with default server.js code downloaded from npm. The winform code:
When this code is run, immediately after disconnection the socket reconnects causing 'Socket hung up' warning on the server after the form is closed.
I understand that I can dispose the client after disconnection.
This is only a test case, but in actual usage scenario I may disconnect from the server without closing the form. Suggest a solution or work around.