Randomly getting unexpected bytes in the ChannelBuffer from test client with valid data
tnine
todd at spidertracks.com
Mon Jan 17 16:05:44 EST 2011
Hi all,
I'm randomly getting errors parsing my binary input off the TCP socket.
The issue appears to be that I'm receiving data in the incorrect stream
position. I've unit tested my Decoder by appending several messages
together and ensuring that each one is consumed individually and all tests
pass. Here is my code.
https://gist.github.com/88dd0f8b5a42c2aa736d
The parsing exception is thrown in the first file, PointBuilder.java on line
17. My ReplayingDecoder delegates to this class for parsing based on the
port of the socket. I have attached all my server files, as well as the
client for testing. Am I doing something wrong with the resetReaderIndex
and markReaderIndex on the underlying ChannelBuffer to read all the bytes
twice? I can't seem to reproduce the issue consistently, out of 20
integration tests usually 1 will fail to read the data properly. Any
suggestions would be greatly appreciated, everything seems to follow the
documentation and the examples exactly, but I'm still getting random
failures.
Thanks,
Todd
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Randomly-getting-unexpected-bytes-in-the-ChannelBuffer-from-test-client-with-valid-data-tp5933385p5933385.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list