New to netty

Trustin Lee tlee at redhat.com
Tue Dec 9 02:08:27 EST 2008


Hello,

There are two ways to wait for the completion of the I/O request.  The
first approach is to call await() or awaitUninterruptibly() of the
ChannelFuture which is returned by an I/O operation (i.e. write(..)).

The second way is to add a listener to the returned ChannelFuture.  Your
listener will be invoked when the operation is done.

I guess what you want is the first approach, right?  If so, please make
sure to add the ExecutionHandler to the pipline if you are going to call
await() or awaitUninterruptible() within the ChannelHandler.  Otherwise
you will never notified on completion (i.e. dead lock) because it is I/O
worker thread that notifies the completion and you are waiting for the
completion in *the* I/O worker thread without ExecutionHandler.

HTH,
Trustin

On Tue, Dec 09, 2008 at 02:26:37PM +0900, manish_iitg wrote:
> 
> Hello,
> 
> I have another basic question to ask. 
> The client that i have created is by default non-blocking. Is their anyway
> to make it non- asynchronous. I want the client to wait for the servers
> reply and the execution of the code in the client side should not move ahead
> till such time. 
 
-- 
Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
--
what we call human nature in actuality is human habit
--
http://gleamynode.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20081209/201619c3/attachment.bin 


More information about the netty-users mailing list