I'm having trouble accepting multiple connections in Winsock.
Here's the code:
It accepts one(1) connection but a second(2nd) cannot connect.Code:Private Sub Form_Load() wsServer(0).LocalPort = 4500 wsServer(0).Listen End Sub Private Sub wsServer_Close(Index As Integer) wsServer(Index).Close End Sub Private Sub wsServer_ConnectionRequest(Index As Integer, ByVal requestID As Long) Dim K As Integer For K = 1 To wsServer.UBound If wsServer(K).State = sckClosed Then Exit For Next K If K = wsServer.UBound + 1 Then Load wsServer(wsServer.UBound + 1) End If wsServer(K).Accept requestID End Sub
Am I doing something wrong?




Reply With Quote