commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <>
Subject Re: The No buffer space available (maximum connections reached?): listen failed Exception
Date Fri, 05 Sep 2008 18:43:22 GMT

[I'm replying from the time-delayed digest, so I apologize in advance
 if someone has already answered this.]

In message <>, chitraa writes:
>Without the custom SocketFactory, the connection seems to hang (Hence the
>reason for customising the SocketFactory to set a timeout value). I could
>not replicate the No buffer space available exception.

What's  probably happening is that the connection is timing out, but
the socket isn't being closed.  For example, in your factory method
you have:
  socket.connect(remoteaddr, clientTimeout);
  return socket;
If the connect times out and throws an exception, the socket should still
be bound.  Therefore, as the application continues to run, it gradually
consumes more and more file descriptors until it runs out.  Try changing
the contents of your factory method to:
  Socket socket = Socket();
  try {
  } catch(IOException ioe) {
    throw ioe;
  return socket;

Presumably, you already know whether or not the connections have
been timing out because you must have an exception handler in your main
application code (else the program would abort assuming your main
is declared as throwing IOException).


o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o o-o-o-o-o-o-o-o-o-o-o-o-o-o
                    Igfip                      o    s a v a r e s e
The strategic alternative for online games(tm).o   software research

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message