i had 3 clients open and logged out 1 client and i get this error
Code:
Private Function GetAvailableSocketIndex() As Integer
Dim AvailIndex As Integer
Dim SocketElement As Variant
Dim n As Integer
'AvailIndex = 0
For n = AcceptedSocket.Count - 1 To 1 Step -1
If AcceptedSocket(n).State = sckClosed Then <<< the (n) count has 2
GetAvailableSocketIndex = n
Exit Function
End If
Next n
GetAvailableSocketIndex = AcceptedSocket.Count
Load AcceptedSocket(GetAvailableSocketIndex)
End Function