You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2008/07/30 10:28:31 UTC

svn commit: r680937 - /incubator/qpid/branches/qpid.0-10/cpp/src/qpid/sys/posix/AsynchIO.cpp

Author: gsim
Date: Wed Jul 30 01:28:30 2008
New Revision: 680937

URL: http://svn.apache.org/viewvc?rev=680937&view=rev
Log:
Added error handling for case where socket cannot be accepted e.g. due to constraints on file handles.


Modified:
    incubator/qpid/branches/qpid.0-10/cpp/src/qpid/sys/posix/AsynchIO.cpp

Modified: incubator/qpid/branches/qpid.0-10/cpp/src/qpid/sys/posix/AsynchIO.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/cpp/src/qpid/sys/posix/AsynchIO.cpp?rev=680937&r1=680936&r2=680937&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/cpp/src/qpid/sys/posix/AsynchIO.cpp (original)
+++ incubator/qpid/branches/qpid.0-10/cpp/src/qpid/sys/posix/AsynchIO.cpp Wed Jul 30 01:28:30 2008
@@ -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 @@
         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);