多个socket的问题
我用一个socket监听,然后用其他的socket和监听到的连接通讯,当一个客户端时通讯没有问题,当有两个以上时,通讯也能实现,但是会经常出现10053 Connection is aborted due to timeout or other failure的错误,然后错误的那个连接重新连接,
Private Sub WinServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
dim strFenID as string
strFenID =WinServer(0).RemoteHostIP
For i = 1 To UBound(g_WinSocketArray)
If g_WinSocketArray(i).ip= strFenID Then
With g_WinSocketArray(i)
.strConnectTime = Format(Now, "yyyy-MM-dd hh:mm:ss")
WinServer(.WinSocketIndex).Accept requestID
End With
Exit For
End If
Next i
End Sub
希望大家给提点建议,我感觉上面的代码应该没有问题,因为上面的问题只是偶尔出现,不知道问题应该出在了什么地方,望指点。