You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by nm...@apache.org on 2007/04/23 18:45:34 UTC
svn commit: r531531 -
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/ServerSocket.cpp
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() );