activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r500075 - /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp
Date Fri, 26 Jan 2007 00:53:43 GMT
Author: nmittler
Date: Thu Jan 25 16:53:42 2007
New Revision: 500075

URL: http://svn.apache.org/viewvc?view=rev&rev=500075
Log:
[AMQCPP-46] Fixed receipt of SIGPIPE on OS X when sending disconnect message on a broken socket

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp?view=diff&rev=500075&r1=500074&r2=500075
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/network/TcpSocket.cpp
Thu Jan 25 16:53:42 2007
@@ -135,19 +135,19 @@
             "Socket::connect- Port out of range: %d", port );
     }
     
-#ifdef SO_NOSIGPIPE
+#ifdef SO_NOSIGPIPE // Don't want to get a SIGPIPE on FreeBSD and Mac OS X
+
+    int optval = 1;
+    if( ::setsockopt( socketHandle, 
+                      SOL_SOCKET, SO_NOSIGPIPE, 
+                      (char*)&optval, 
+                      sizeof(optval)) < 0 )
     {
-        int optval = 1;
-        if( ::setsockopt( socketHandle, 
-                          SOL_SOCKET, SO_NOSIGPIPE, 
-                          (char*)&optval, 
-                          sizeof(optval)) < 0 )
-        {
-            close();
-            throw SocketException ( __FILE__, __LINE__, 
-                "Socket::connect- Failed setting SO_NOSIGPIPE: %s", SocketError::getErrorString().c_str()
);
-        }
+        close();
+        throw SocketException ( __FILE__, __LINE__, 
+            "Socket::connect- Failed setting SO_NOSIGPIPE: %s", SocketError::getErrorString().c_str()
);
     }
+    
 #endif
     
     sockaddr_in target_addr;



Mime
View raw message