You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/07/25 21:28:05 UTC

svn commit: r559568 - /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/TcpSocket.cpp

Author: tabish
Date: Wed Jul 25 12:28:04 2007
New Revision: 559568

URL: http://svn.apache.org/viewvc?view=rev&rev=559568
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103

Working on APRizing the sockets, currently broken.

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/TcpSocket.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/TcpSocket.cpp?view=diff&rev=559568&r1=559567&r2=559568
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/TcpSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/net/TcpSocket.cpp Wed Jul 25 12:28:04 2007
@@ -88,11 +88,14 @@
             &socketHandle, socketAddress->family, SOCK_STREAM, APR_PROTO_TCP, apr_pool ) );
 
         // it is a good idea to specify socket options explicitly. in this
-        // case, we make a blocking socket with timeout, this should allow us
+        // case, we make a blocking socket with system timeout, this should allow us
         // the time needed to connect to the socket before returning, but not
-        // block us forever waiting if there isn't anyone there..
-        apr_socket_opt_set( socketHandle, APR_SO_NONBLOCK, 1 );
-        apr_socket_timeout_set( socketHandle, 1000 );
+        // block us forever waiting if there isn't anyone there.  Some poeple
+        // say that you shouldn't use this mode as its an OS timeout that is not
+        // controllable, if this becomes an issue, we should decide on what a
+        // reasonable timeout should be and set it here.
+        apr_socket_opt_set( socketHandle, APR_SO_NONBLOCK, 0 );
+        apr_socket_timeout_set( socketHandle, -1 );
 
         checkResult( apr_socket_connect( socketHandle, socketAddress ) );