Structured message reading problem in Netty.

manishr22 manishr22 at gmail.com
Fri May 1 06:54:59 EDT 2009


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.

Regards,
Manish 




Frederic Bregier wrote:
> 
> Hi Manish,
> 
> DISONNECTED and UNBOUND obviously mean that the channel is closed.
> Either the server or the client can be the root of the disconnection.
> 
> From your handler, it does not seemed that it is the root cause.
> 
> Could it be your client that try to send one packet and then to
> disconnect,
> or another scenrario, client connects, then sends all they packet and
> doesn't wait
> anything from the server to disconnect ?
> 
> For instance:
> - client try to connect
> - server creates all necessary handlers
> - client as soon as it is connect send the packets
> - server starts to receive one packet
> - client don't wait for anything from the server after sending all its
> packet
>   (from its point of view) and close the connection.
> - server has only the time to consume one packet and then get the
> disconnection
>   so that it cannot goes to the next messages... (I think disconnection is
>   prioritary to any other messages) 
> 
> If so, perhaps you should have to send something like a "end of
> transmission" from
> the server to the client, the client will wait for this ackonwledge to
> close
> the connection... ?
> 
> HTH,
> Frederic
> 
> 

-- 
View this message in context: http://n2.nabble.com/Structured-message-reading-problem-in-Netty.-tp2682454p2752587.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list