Closing Channels in Netty

Mike McGrady mmcgrady at topiatechnology.com
Tue Aug 25 03:11:18 EDT 2009


Explains why when closing server side with large file chunking I get a  
performance hit

Sent from my iPhone

On Aug 24, 2009, at 11:23 PM, 이희승 (Trustin Lee)  
<trustin at gmail.com> wrote:

> On Tue, 25 Aug 2009 12:08:55 +0900 (KST)
> Thomas Bocek <bocek at ifi.uzh.ch> wrote:
>
>> Michael McGrady wrote:
>>> Here is hopefully an easy question that I have not been doing good
>>> with.  What is the best way to close a channel at both the sender
>>> and receiver (client and server) ends?
>>
>> Channel.close() will close a TCP channel on the server and client
>> side. So you can call close() from either sender or receiver and it
>> will close both sides.
>
> To add just a little bit, the side that closes the connection will get
> a TIME_WAIT state.  Therefore, it's better for the side with fewer
> connections to close the connection to reduce the chance of running
> out of ports due to too many TIME_WAIT states. In most case, it's the
> client side because the server side often handles much more  
> connections.
>
> HTH,
> Trustin
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users



More information about the netty-users mailing list