-
theory
i made this code, and i dont know if it works, and i cant test it right now, will you take a look and tell me what i need to change, add
thanks
Code:
Private Sub Client_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim Buffer As String
Dim I As Long
Call Client(Index).GetData(Buffer, vbString, byestotal)
Let Client(Index).Tag = Client(Index).Tag & Buffer
Let I = InStr(1, Client(Index).Tag, sckSep)
If I < 2 Or I > 3 Then
Dim Ban As CBan: Set Ban = New CBan
Let Ban.By = "Server"
Let Ban.IP = Client(Index).RemoteHostIP
Let Ban.Reason = "sckSep position < 2 or > 3"
Let Ban.Time = CDate(Date$ & " " & Time$)
Call DB.Bans.Add(Ban, Ban.IP)
Call Client_Close(Index)
Exit Sub
End If
Let I = InStr(1, Client(Index).Tag, sckEnd)
While I
Let Buffer = Mid$(Client(Index).Tag, 1, I)
Let Client(Index).Tag = Right$(Client(Index).Tag, I + 1)
If Len(Buffer) Then
Call ProcessData(Index)
End If
Let I = InStr(1, Client(Index).Tag, sckEnd)
Wend
End Sub
-
Re: theory
-
Re: theory
what is coming in through the buffer?
-
Re: theory
i dont know i cant test the code yet... but can you see anything wrong?
i also have a question... what does PeekData do?
-
Re: theory
should check the memory location. i was just wondering what SHOULD be coming through. I don't know how big the .tag buffer is, that's why i wondered.
-
Re: theory
PeekData reads the received data without erasing it from the buffer afterwards.
-
Re: theory
oooh...
just like GetMsg and PeekMsg in the W32 SDK
ok... so peekdata is useless