How to close a connection *immediately*.

"Trustin Lee (이희승)" trustin at gmail.com
Tue Jun 1 02:40:31 EDT 2010


Hi Luis,

Channel.close() always closes a connection immediately.  Any pending
writes will fail with an exception.  If this is not what you observed,
please let me know how you can reproduce the problem.

Thanks,
Trustin

Luis Neves wrote:
> It doesn't seem possible to close an established connection when the
> write queue is full.
> 
> The following idiom doesn't seem to work:
> 
> if (channel.isWritable())
> {
> channel.write(message);
> }
> else
> {
> channel.close();
> }
> 
> 
> the channelClosed() method in the handler is not called. I presume
> because there still messages in the write queue.
> 
> How can I effectively close the connection?
> 
> TIA.
> 
> --
> Luis Neves
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users

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



More information about the netty-users mailing list