Hi there,
I made a simple remote Server / Client application and it's working fine, but the Client wont reconnect at the second time, it will only work if I exit the Server and rerun it.
I'm getting error on second reconnect attempt "10061 - Connection is forcefully rejected".
Server code:
I really don't know where would be the issue.Code:Private Sub Form_Load() With wskServer .Protocol = sckTCPProtocol .RemotePort = 0 .LocalPort = 51393 .Listen End With Debug.Print "TCP Server started..." Debug.Print "- Host: " & wskServer.LocalHostName Debug.Print "- IP: " & wskServer.LocalIP Debug.Print "- Port: " & wskServer.LocalPort Debug.Print "=============================" Exit Sub Private Sub wskServer_ConnectionRequest(ByVal requestID As Long) If wskServer.State <> sckClosed Then wskServer.Close wskServer.Accept requestID Debug.Print "Client connected from IP: " & wskServer.RemoteHostIP & ", Port: " & wskServer.RemotePort End Sub Private Sub wskServer_Close() Debug.Print "Client disconnected from IP: " & wskServer.RemoteHostIP & ", Port: " & wskServer.RemotePort End Sub Private Sub wskServer_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) MsgBox "Error " & Number & ": " & Description End Sub
Any guidance is highly appreciated!![]()




Reply With Quote
