Write on channel on channelConnected()

Bruno Mello bruno.mello at sapo.pt
Thu Mar 18 13:50:52 EDT 2010


Hello all,

I think I found a bug on Netty 3.2.0 BETA1.

If I try to write on a channel inside the channelConnected method I get a
"java.lang.IllegalArgumentException: unsupported message type" exception. 

   public void channelConnected(final ChannelHandlerContext ctx, final
ChannelStateEvent e) {
      ctx.getChannel().write("hello");
   }

Also, if I put a long routine in channelConnected if behaves in an
unexpected fashion:

For instance, a client connects after pressing a button and when connected
it displays a message "connected".

With the code bellow the message "connected" only shows up 5 seconds before
pressing the button.

   public void channelConnected(final ChannelHandlerContext ctx, final
ChannelStateEvent e) {
       Thread.sleep(5000);
   }

>From my understanding channelConnected should be called AFTER the channel is
really connected and ready to exchange messages.

Thanks.
-- 
View this message in context: http://n2.nabble.com/Write-on-channel-on-channelConnected-tp4758162p4758162.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list