Stateful TCP conversation

Joern Barthel joern.barthel at gmail.com
Sat Mar 6 17:44:29 EST 2010


Hello list,

I am trying to write a TCP/IP client which communicates with a server in a stateful manner. The initial handshake sequence goes like this:

 - Client opens connection, sends a predefined constant.
 - Server replies with packet A
 - Client responds with A'
 - Server replies with packet B ... and so on until the connections parameters have been negotiated.

This works up to step A'. The packet apparently never arrives at the remote host and Wireshark tells me the packet is an "unreassembled packet (incorrect tcp checksum)". This might be due to checksum offloading (I am testing on local loopback) but right now it's the only clue I got.

The setup: a NioClientSocketChannelFactory and a ChannelPipeline with three upstream handlers (frame assembly, pojo decoding and handshare handling). I write the constant channel buffer into the toplevel channel (via connection.awaitUninterruptibly().getChannel()). The handshake handler receives packet A, builds A' and writes it back to the channel. I tried writing it to the toplevel channel instance instead, removing the handlers and doing the whole logic procedurally. Any ideas what I could be doing wrong?

Best regards,


Joern
--







More information about the netty-users mailing list