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:39:47 UTC

svn commit: r680939 - /incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp

Author: gsim
Date: Wed Jul 30 01:39:46 2008
New Revision: 680939

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


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp

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