Not receiving all data after attempting to close the channel.

Trustin Lee (이희승) trustin at gmail.com
Fri Nov 20 22:19:45 EST 2009


Hi Stephen,

On Fri, Nov 20, 2009 at 4:24 AM, Stephen Pape
<Stephen.Pape.ctr at rl.af.mil> wrote:
>
> Thanks for the reply. Isn't what you're doing essentially the same thing?
> You're getting notified via operationComplete() that the write was
> (supposedly) completed, then allowing execution to continue. That seems like
> what I'm doing, except I immediately close the channel.
>
> I found a similar thread about this topic here:
> http://www.jboss.org/netty/community.html#nabble-td3398725|a3398725
>
>
> Trustin Lee wrote:
>>
>> You can achieve this pretty simply:
>>
>>   channel.write(ChannelBuffers.EMPTY_BUFFER)
>>          .addListener(ChannelFutureListener.CLOSE);
>>
>
> Given that response, I assumed my method should work. I was doing the same
> thing, adding a listener to close after the last write completed. I wasn't
> using an empty buffer because my channel pipeline couldn't accept a
> ChannelBuffer directly.
>
> Is there some reason that the channel can't be closed immediately after a
> write has completed?

I think you are closing the connection properly.  I never experienced
the same problem, but it worths an investigation just in case.   Can
you reproduce the problem with loopback connection?  Do you have a
simple application that reproduces the problem?

Thanks
T



More information about the netty-users mailing list