Questions about asynchronous write operations

Nicholas Clare nickclare at gmail.com
Tue Apr 21 02:45:21 EDT 2009


On Sat, Apr 18, 2009 at 4:23 PM, Trustin Lee <tlee at redhat.com> wrote:
> On Sat, Apr 18, 2009 at 3:30 AM, Nicholas Clare <nickclare at gmail.com> wrote:
>> Hi Utkarsh,
>>
>> I'm not totally sure about the first question, but I believe that they
>> are written properly.
>
> You are right.  Two write requests never get mixed up.  They are
> written in the order where write() was called.
>
>> The second question I do know, because I was
>> reading the code involved just a little while ago. In the
>> DefaultChannelListener class, it checks whether the task represented
>> by the future is done when you add it, and if so, it is called. So the
>> answer is yes, your listener will be called no matter if it's added
>> before or after the write finishes
>
> Exactly.  If the operation associated with a ChannelFuture is already
> done, any newly added ChannelFutureListener will be notified
> immediately.
>
> BTW, you meant DefaultChannelFuture rather than
> DefaultChannelListener, right? ;)
>
> Thanks!
> Trustin
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>

Hi,

DefaultChannelFuture is what I meant, thanks.

Nick




More information about the netty-users mailing list