VB Code:
Private Sub sckServer_ConnectionRequest(index As Integer, ByVal requestID As Long)
If index = 0 Then
intWIndex = intWIndex + 1
Load sckServer(intWIndex)
sckServer(intWIndex).Accept requestID
AddLog "Socket connection request accepted -> index = " & intWIndex
End If
now my problem is, in some time while the program is running, some of the winsock in the server gets this error ''Connection is aborted due to timeout or other failure" but in the client side there is no winsock error for that particular connection. i have this code to handle this error :
VB Code:
Private Sub sckServer_Error(index As Integer, 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)
If index = 0 Then Exit Sub
'close connection
sckServer(index).Close
'unload socket
Unload sckServer(index)
End Sub
in the client side, whenever a winsock error occurs, i close the connection and i have a timer enabled so that the client would automatically try to reconnect to the server. but since no winsock error occurred, the client will not try to reconnect.