PDA

Click to See Complete Forum and Search --> : inconsistent connectionRequest


kenny_oh
Oct 10th, 2005, 11:34 AM
below is my server side winsock listen for connection...but that is happen inconsistent where some time accept connection , sometime couldnt get connection, why this happen??? it is the number port i use?

connect = 0
connectWinsock(0).LocalPort = 10000
connectWinsock(0).Listen

Private Sub connectWinsock_ConnectionRequest(Index As Integer, ByVal requestID As Long)

connect = connect + 1

Load connectWinsock(connect)
connectWinsock(connect).Close
connectWinsock(connect).Accept requestID

connectWinsock(connect).SendData ("Connected")

End Sub

Private Sub connectWinsock_DataArrival(Index As Integer, ByVal bytesTotal As Long)

Dim state As String
connectWinsock(Index).GetData state

List3.AddItem (state & vbTab & vbTab & connectWinsock(Index).RemoteHostIP)
List1.AddItem (state & " just sign In!")

Call buddyDictionary.Add(state, connectWinsock(Index).RemoteHostIP)

End Sub

aneu
Oct 12th, 2005, 04:15 AM
the same thing happends to me... I don't know why... if u can find the solution, please contact me.

PS: the port isn't the problem... i tried on many ports and all of them had the same problem...

this happends when more people try to connect at the same time... i think