Structured message reading problem in Netty.

Trustin Lee tlee at redhat.com
Thu May 21 08:34:35 EDT 2009


Hi Manish,

On Fri, May 1, 2009 at 7:54 PM, manishr22 <manishr22 at gmail.com> wrote:
>
> Hi Frederic,
>
> Thanks for your clarification. But the problem is, we are trying to make a
> asynchronous TCP/Ip communication then there should be any dependency on
> client.
>
> In my existing code what you said is exactly right.
>
> - I have my normal client (non-netty) it creates TCP connection and send as
> much data it wants and terminates.
> - I believe as much data client has written on the socket should be read by
> server.
> - In my case i have several such client and they can send as many number of
> message to the server they want. how come i understand when to send back
> "end of transmission" to the client, then only client should disconnect.
> - The workaround is my client should send "bye/final" after all its messages
> then in the echo from server send back the same and then only i should close
> connection from client. But this way i am synchronizing my server with
> client.
> - If i have my server with normal socket, even though my client connection
> goes down, server will still be reading all buffered socket data without any
> problem.
> - In what sense netty is differentiating here.

Netty also should finish reading all data and then find that the
connection has been closed.  That's how O/S stream I/O works so the
expected behavior you described will always be achieved with any
socket application.  Please let me know if you are still experiencing
the problem and how I can reproduce the problem as simply as possible.

HTH,

— Trustin Lee, http://gleamynode.net/




More information about the netty-users mailing list