activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r531531 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp
Date Mon, 23 Apr 2007 16:45:34 GMT
Author: nmittler
Date: Mon Apr 23 09:45:33 2007
New Revision: 531531

URL: http://svn.apache.org/viewvc?view=rev&rev=531531
Log:
AMQCPP-107 - adding handling of signal interruptions to ServerSocket

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp?view=diff&rev=531531&r1=531530&r2=531531
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp Mon
Apr 23 09:45:33 2007
@@ -199,8 +199,18 @@
         int temp_len = sizeof( sockaddr_in );
     #endif
 
-    SocketHandle ss_socket_handle = 
-        ::accept( socketHandle, reinterpret_cast<struct sockaddr*>(&temp), &temp_len
);
+    SocketHandle ss_socket_handle = NULL;
+    
+    // Loop to ignore any signal interruptions that occur during the operation.  
+    do {
+        
+        ss_socket_handle = ::accept( socketHandle, 
+                                     reinterpret_cast<struct sockaddr*>(&temp),

+                                     &temp_len );
+        
+    } while( ss_socket_handle < 0 && 
+             SocketError::getErrorCode() == SocketError::INTERRUPTED );
+        
     if( ss_socket_handle < 0 ) {
         throw SocketException( __FILE__, __LINE__, 
             "ServerSocket::accept- %s", SocketError::getErrorString().c_str() );



Mime
View raw message