[RESOLVE]Check Socket Connections
Is there a way to have a socket check all its Index's to see if they are still connected and if not then it closes the index on its side and recounts?
Cause Im having a problem with a client disconnecting and the server doesnt relise it.
Thanks in advance.
Re: Check Socket Connections
i dunno about recounting and closing but i was searching forums and i found
VB Code:
Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal RequestID As Long)
Dim number As Integer
' Load another winsock then accept the connection through that winsock
If Winsock1.UBound < 1 Then 'this is our first connection so accept it
Load Winsock1(Winsock1.UBound + 1)
Winsock1(Winsock1.UBound).Accept RequestID
End If
For x = 1 To Winsock1.UBound 'loops through existing connections to amke sure we have none spare
If Winsock1(x).State <> sckConnected Then
Winsock1(x).Close
Winsock1(x).Accept RequestID
Else
If x >= Winsock1.UBound Then 'there si none spare so accept on new socket
Load Winsock1(Winsock1.UBound + 1)
Winsock1(Winsock1.UBound).Accept RequestID
Exit Sub
End If
End If
Next x
End Sub
so thats what i use until i find something thats exactly like what ur looking for
Re: Check Socket Connections
Not what I had in mind. That just closes all the sockets that are connected to my server.
Re: Check Socket Connections
Never mind, got it to work with a little custom sub and stuff. Thanks anyway.