summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/src/qpid/sys/posix/AsynchIO.cpp15
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 470db4c614..4eb6d0a3e7 100644
--- a/cpp/src/qpid/sys/posix/AsynchIO.cpp
+++ b/cpp/src/qpid/sys/posix/AsynchIO.cpp
@@ -21,6 +21,7 @@
#include "qpid/sys/AsynchIO.h"
#include "qpid/sys/Time.h"
+#include "qpid/log/Statement.h"
#include "check.h"
@@ -85,11 +86,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);