Shutting Down of Application - timeout

Chew Kok Hoor (SolutionX) kokhoor at solutionx.com.my
Mon Jun 14 00:31:35 EDT 2010


Hi all,

  I am a newbie using Netty, so sorry if this is a stupid question.
  
  I have modified the Proxy application so that it can run as a win32
service (using Apache Procrun) and to support multiple redirection ports.
  
  However, I noticed upon shutdown, it shutdown very slowly, and hence I
receive a timeout upon disconnecting. Right now, the way I do it is to
create a ChannelGroup, and add all the Server Channels I have created into
it. On close, I run the following:
  
    ChannelGroupFuture future = allChannels.close()
    future.awaitUninterruptibly();
    factory.releaseExternalResources();

  I suspect, therefore that the timeout might be due to the fact that Client
Channels created to connect to the destination I am proxying is still open.

  Question is, do I have to add all the Client Channels created to the
ChannelGroup too?

  If this is the case, will it cause any side effects such as Out of Memory,
when too many Client Channels are added to the ChannelGroup?

  Or do I have to do my own housekeeping and remove a Client Channel from
the Channel Group whenever it is closed?

  By the way, keep up the good work. Netty is a very good project. I used to
use MINA, and comparatively, Netty might look more complicated to use
upfront, but it certainly provides you with more power, which is certainly a
good thing for low-level libraries like Netty and MINA.

Regards,
    Kok Hoor




More information about the netty-users mailing list