Network - Where does the data come from?
BlitzMax Forums/BlitzMax Programming/Network - Where does the data come from?
| ||
It's probably me but I just can't solve this strange problem that I got when trying to write a network lib. (I use BNet by Vertex) I send 18bytes but the client receives over 130kbytes. I mean how can that happen? It happens when the Client reads 1 byte, his ID. Then he reads the rest of the stream into a string (which in short is the host's name$ and info$) but somehow this string gets way huge! (131071 bytes)- which I check with Len(StringReceived$). The Sent STring was a couple of bytes only! Anyway this means the client stalls each time he joins. Anyone got any ideas about what it could be? I'll keep debugging whishing for the best. |
| ||
.... My... PANTS! To be honest, I have no idea. |
| ||
Phew, found it. Don't know how it happend really. Or why it happend. Seemed like the data received was exponetially increasing depending on the data sent. It all had to do with a WriteShort(), which should have been a WriteByte().. Grr.. Wierd bug^^ |
| ||
Obviously I didn't sole it.. When the name and Info was set = 0 it works, but as I increase the size of this string the problem arises again. 1b -> 3b 2b -> 7b 3b -> 15b 4b -> 31b 5b -> 63b I send A1B2 and receive: AA1AA1BAA1AA1B2 Can anyone calculate (or guess) what is happening here? EDIT - Solved it.. OMG Could a bug be more annoying? The reason for the bug was that I went: While not end of stream DataString$:+ DataString + Readbyte() Wend Which added each string onton of itself two type + the byte.. That what happens when you get code-blind. |