Netty close the channel internally, I can't figure out why

"이희승 (Trustin Lee)" trustin at gmail.com
Mon Jan 10 00:49:39 EST 2011


On 11/18/2010 04:10 PM, fujohnwang(王福强) wrote:
> 
> Hi, Trustin
> I hope it doesn't bother you since I have another question on netty, maybe
> it's naive since netty has been there for a long time.
> 
> I have always used netty in some client application, so I haven't written a
> server with netty yet. But now, I have such a chance to do this, so in some
> minor scenarios I can't figure out clearly with the internal details of
> netty.
> 
> I want to know whether netty create a new channel pipeline every time when
> it accept a socket in the server side, 

Yes, a new pipeline is created for every new channel, as described in
the ChannelPipelineFactory Javadoc:

    When a server-side channel accepts a new incoming connection, a new
    child channel is created for each newly accepted connection. A new
    child channel uses a new ChannelPipeline, which is created by the
    ChannelPipelineFactory specified in the server-side channel's
    "pipelineFactory" option.

> if so then in the
> SimpleChannelHandler, what's the different with channelOpended and
> childChannelOpened?

childChannelOpened event is used only for a ServerSocketChannel.  In
most cases, it is used only for an internal implementation, so you are
safe to skip it.

HTH,
Trustin
-- 
Trustin Lee, http://gleamynode.net/

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


More information about the netty-users mailing list