[haXe] Re: bug in neko.net.ServerLoop?
Nicolas Cannasse
ncannasse at motion-twin.com
Sun Nov 5 15:06:12 CET 2006
> thanks for the info Nicolas,
> ok, i don't understand enough about it all but i usually see this output with a
> couple of trace statements i have:
>
> ServerLoop.hx:167: cl.bufbytes:6138
> SqueakServer.hx:64: returnLen:6138 buflen:6138 bufpos:0 MAX_BUFSIZE:65536
>
> that trace from server loop happens after line 166: cl.bufbytes += nbytes;
>
> before the crash i get this:
>
> ServerLoop.hx:167: cl.bufbytes:1441
> SqueakServer.hx:64: returnLen:6138 buflen:1441 bufpos:0 MAX_BUFSIZE:65536
>
> notice that returnLen is bigger. returnLen is the length of the data i am
> grabbing. the server then crashes with:
>
> ServerLoop.hx:146: $sblit
> Called from neko/net/ServerLoop.hx line 221
> Called from neko/net/ServerLoop.hx line 180
> Called from neko/Lib.hx line 98
>
> below is the code i am using where returnLen is calculated
This is very normal.
Data is sent by packets, so when reading an amount of data there is no
waranty that the whole data you sent has already been received. It's up
to you to return "0" when you don't have enough data available.
The method processClientData will then be called again when more data is
available. NEVER returns more readedBytes than buflen.
Nicolas
More information about the Haxe
mailing list