activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r834677 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net: ServerSocket.cpp Socket.h TcpSocket.cpp TcpSocket.h
Date Tue, 10 Nov 2009 21:30:47 GMT
Author: tabish
Date: Tue Nov 10 21:30:47 2009
New Revision: 834677

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

Remove the old INVALID_SOCKET_HANDLE flag as it serves no purpose now that the code uses APR.

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp?rev=834677&r1=834676&r2=834677&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ServerSocket.cpp Tue Nov 10
21:30:47 2009
@@ -31,7 +31,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 ServerSocket::ServerSocket() {
-    socketHandle = (apr_socket_t*)Socket::INVALID_SOCKET_HANDLE;
+    socketHandle = NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -69,7 +69,7 @@
         &socketAddress, host, APR_INET, port, 0, apr_pool.getAprPool() );
 
     if( result != APR_SUCCESS ) {
-        socketHandle = (apr_socket_t*)Socket::INVALID_SOCKET_HANDLE;
+        socketHandle = NULL;
         throw SocketException(
               __FILE__, __LINE__,
               SocketError::getErrorString().c_str() );
@@ -80,7 +80,7 @@
         &socketHandle, APR_INET, SOCK_STREAM, APR_PROTO_TCP, apr_pool.getAprPool() );
 
     if( result != APR_SUCCESS ) {
-        socketHandle = (apr_socket_t*)Socket::INVALID_SOCKET_HANDLE;
+        socketHandle = NULL;
         throw SocketException(
               __FILE__, __LINE__,
               SocketError::getErrorString().c_str() );
@@ -119,13 +119,13 @@
 
     if( isBound() ) {
         apr_socket_close( socketHandle );
-        socketHandle = (apr_socket_t*)Socket::INVALID_SOCKET_HANDLE;
+        socketHandle = NULL;
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 bool ServerSocket::isBound() const {
-    return this->socketHandle != (apr_socket_t*)Socket::INVALID_SOCKET_HANDLE;
+    return this->socketHandle != NULL;
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/Socket.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/Socket.h?rev=834677&r1=834676&r2=834677&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/Socket.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/Socket.h Tue Nov 10 21:30:47
2009
@@ -42,11 +42,6 @@
          */
         typedef apr_sockaddr_t* SocketAddress;
 
-        /**
-         * Defines a constant for an invalid socket handle.
-         */
-        static const int INVALID_SOCKET_HANDLE = 0;
-
     public:
 
         virtual ~Socket() {}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp?rev=834677&r1=834676&r2=834677&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.cpp Tue Nov 10 21:30:47
2009
@@ -29,14 +29,14 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 TcpSocket::TcpSocket() throw ( SocketException )
-  : socketHandle( static_cast< SocketHandle >(INVALID_SOCKET_HANDLE) ),
+  : socketHandle( NULL ),
     inputStream( NULL ),
     outputStream( NULL ) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 TcpSocket::TcpSocket( SocketHandle socketHandle )
- :  socketHandle( static_cast< SocketHandle >(INVALID_SOCKET_HANDLE) ),
+ :  socketHandle( NULL ),
     inputStream( NULL ),
     outputStream( NULL ) {
 
@@ -159,7 +159,7 @@
         if( isConnected() ) {
             apr_socket_shutdown( socketHandle, APR_SHUTDOWN_READWRITE );
             apr_socket_close( socketHandle );
-            socketHandle = INVALID_SOCKET_HANDLE;
+            socketHandle = NULL;
         }
     }
     DECAF_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.h?rev=834677&r1=834676&r2=834677&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/TcpSocket.h Tue Nov 10 21:30:47
2009
@@ -117,7 +117,7 @@
          * @return true if connected
          */
         virtual bool isConnected() const{
-            return socketHandle != INVALID_SOCKET_HANDLE;
+            return socketHandle != NULL;
         }
 
         /**



Mime
View raw message