Lifecycle methods for a SimpleChannelHandler

"Trustin Lee (이희승)" trustin at gmail.com
Wed Jan 6 22:30:00 EST 2010


Hi Srikanth,

srikanthlives wrote:
> Hi,
> 
> I am new to netty and exploring this for a game application where the
> clients need socket connections.
> 
> I just wondered if there is a way in the "SimpleChannelHandler" to know
> whether the client got connected, disconnected and whether the disconnection
> is graceful (client asked for) or forceful (client closed application) along
> with the messageRecived() function. is there a way in the netty to know
> about the above life cycle events?

Netty does not implement it out of the box because it is highly
dependent on the user application's implementation detail.

In general, for graceful disconnection, the client needs to send some
message like GOOD-BYE.  If no GOOD-BYE message was received and your
server did not close the connection by calling Channel.close(), it's
probably the client who disconnected forcefully.  However, the
connection might have been closed by the server side operating system
for various reasons.

HTH,
Trustin

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100107/5319774c/attachment.bin 


More information about the netty-users mailing list