It took me a while, but I finally figured out why I only get a 0x25 (Ping, or ASCII 37, I hope...) and I do not get a reply to 0x50...
If packets are sent that close together, and I call ReadAll from my socket, it gets both packets in one message.
So I tried to write a little buffer, which failed, because I still only get a packet with the ID of ASCII 37...
Here is what I thought up:
dim mypacket as new ParsePacket
dim s, ss as string
s = me.ReadAll
if CountFields(s, chr(&HFF)) - 1 = 1 then
// We just have one packet... Lucky us!
else
// More then one packet, so parse
while CountFields(s, chr(&HFF)) - 1 <> 0
ss = ss + leftb(s, 1)
s = midb(s, 2)
if LenB(ss) > 1 then
if asc(rightb(s, 1)) = &HFF then
s = chr(&HFF) + s
ss =left(ss, len(ss) - 1)
mypacket.UseData ss
mypacket = new ParsePacket
end if
end if
wend
end if
I quickly found out I was doing something dead wrong, and there must be a better way.
Please help, and, as always, thanks in advance.