ChannelSink.eventSunk() doesn't catch OPEN state with TRUE as value

"이희승 (Trustin Lee)" trustin at gmail.com
Tue Aug 11 22:58:28 EDT 2009


Hi Rafael,

On 08/12/2009 09:09 AM, Rafael Marins wrote:
> 
> Hello Netties!
> 
> I'm working on the development of an Common-ISDN-API (CAPI 2.0) transport
> for JBoss Netty. When implementing my IsdnChannelSink extending from
> AbstractChannelSink, and using the BootstrapClient to make the connection,
> the first events caught by the eventSunk() method have the following order
> of occurrence:
> 
> 1st - BOUND with SocketAddress as value
> 2nd - CONNECTED with SocketAddress as value
> 
> Shouldn't the correct behavior be catching the OPEN state with TRUE value
> first of all?

A Channel is supposed to be open when it is constructed.  If you take a
look into the source code of a Channel implementation, you will find
that it triggers a channelOpen event in its constructor.  Therefore,
there is no need to send OPEN(TRUE) downstream - it's open already and
hence no need to request it.

> Analyzing the BootstrapClient class I've identified that the Connector inner
> class is responsible for firing the connected event.

Actually ClientBootstrap.Connector simply forwards the channelConnected
event to your handler.  It's NioWorker.RegisterTask that initiates the
event.

HTH,
Trustin


More information about the netty-users mailing list