diff options
| author | Gordon Sim <gsim@apache.org> | 2008-07-30 08:39:46 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-07-30 08:39:46 +0000 |
| commit | bba391aa3a21fcc6df108cf0790ef283293249cf (patch) | |
| tree | ca915f2dd2624d1c1236dc483004ff93938fcc39 /cpp/src/qpid | |
| parent | 7166856e59dde9d6590d8abe54f0deb73b751282 (diff) | |
| download | qpid-python-bba391aa3a21fcc6df108cf0790ef283293249cf.tar.gz | |
Merged r680937. Added error handling for case where socket cannot be accepted e.g. due to constraints on file handles.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@680939 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
| -rw-r--r-- | cpp/src/qpid/sys/posix/AsynchIO.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpp/src/qpid/sys/posix/AsynchIO.cpp b/cpp/src/qpid/sys/posix/AsynchIO.cpp index 1231698eea..2d9bdbd3d8 100644 --- a/cpp/src/qpid/sys/posix/AsynchIO.cpp +++ b/cpp/src/qpid/sys/posix/AsynchIO.cpp @@ -22,6 +22,7 @@ #include "qpid/sys/AsynchIO.h" #include "qpid/sys/Socket.h" #include "qpid/sys/Time.h" +#include "qpid/log/Statement.h" #include "check.h" @@ -87,11 +88,15 @@ void AsynchAcceptor::readable(DispatchHandle& h) { errno = 0; // TODO: Currently we ignore the peers address, perhaps we should // log it or use it for connection acceptance. - s = socket.accept(0, 0); - if (s) { - acceptedCallback(*s); - } else { - break; + try { + s = socket.accept(0, 0); + if (s) { + acceptedCallback(*s); + } else { + break; + } + } catch (const std::exception& e) { + QPID_LOG(error, "Could not accept socket: " << e.what()); } } while (true); |
