Server Code for Server: (Port 999)
And the client part is pretty streight forward.Code:Private Sub Socket_ConnectionRequest(Index As Integer, ByVal requestID As Long) 'Declares Memory Variables Dim lngA As Long Dim strRemoteIP As String 'Sets Variables strRemoteIP = Socket(Index).RemoteHostIP 'Checks If IP's banned If IsBanned(strRemoteIP) = True Then Exit Sub 'Loops through each Socket For lngA = 1 To Socket.UBound 'Checks for Free Socket If Socket(lngA).State <> 7 Then 'Closes Socket Socket(lngA).Close Socket(lngA).Accept requestID 'Removes All Data from SubSocket Call DumpSubSocket(Index) 'Ends Execution Exit Sub End If Next lngA 'Finds Upper Bound of Socket plus one lngA = Socket.UBound + 1 'Removes All Data from SubSocket ReDim SubSocket(lngA) Call DumpSubSocket(CInt(lngA)) 'Loads New Socket Load Socket(lngA) Socket(lngA).Close Socket(lngA).Accept requestID End Sub
Again, it connects fine. Then I close the application (in VB IDE) and relaunch it b/c I changed something and it doesnt work. Then, if I give it a few minutes and run the exact same code it does work. Kind of odd to me. As for the programming, I do know what I'm doing so that shouldnt be a problem.Code:'Attempts to Connect to Central Data Server frmMain.SocketT2A.Close frmMain.SocketT2A.Connect "127.0.0.1", 999
Also on the server side; it doesnt banned anyone yet. So that shouldnt effect anything. I would release all the code but I cant![]()




Reply With Quote