activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r964840 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net: InetAddress.cpp InetAddress.h
Date Fri, 16 Jul 2010 15:39:57 GMT
Author: tabish
Date: Fri Jul 16 15:39:56 2010
New Revision: 964840

URL: http://svn.apache.org/viewvc?rev=964840&view=rev
Log:
fix for: https://issues.apache.org/activemq/browse/AMQCPP-303

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

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp?rev=964840&r1=964839&r2=964840&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.cpp Fri Jul 16
15:39:56 2010
@@ -37,9 +37,6 @@ using namespace decaf::internal;
 const unsigned char InetAddress::loopbackBytes[4] = { 127, 0, 0, 1 };
 const unsigned char InetAddress::anyBytes[4] = { 0, 0, 0, 0 };
 
-const InetAddress InetAddress::LOOPBACK( Inet4Address( "localhost", InetAddress::loopbackBytes,
4 ) );
-const InetAddress InetAddress::ANY( Inet4Address( InetAddress::anyBytes, 4 ) );
-
 ////////////////////////////////////////////////////////////////////////////////
 InetAddress::InetAddress() {
 }
@@ -161,7 +158,7 @@ InetAddress InetAddress::getLocalHost() 
     apr_status_t result = apr_gethostname( hostname, APRMAXHOSTLEN+1, pool.getAprPool() );
 
     if( result != APR_SUCCESS ) {
-        return InetAddress::LOOPBACK;
+        return getLoopbackAddress();
     }
 
     apr_sockaddr_t* address = NULL;
@@ -195,3 +192,13 @@ unsigned int InetAddress::bytesToInt( co
 
     return value;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+InetAddress InetAddress::getAnyAddress() {
+    return Inet4Address( "localhost", InetAddress::loopbackBytes, 4 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+InetAddress InetAddress::getLoopbackAddress() {
+    return Inet4Address( InetAddress::anyBytes, 4 );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.h?rev=964840&r1=964839&r2=964840&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/InetAddress.h Fri Jul 16 15:39:56
2010
@@ -36,9 +36,6 @@ namespace net {
         static const unsigned char loopbackBytes[4];
         static const unsigned char anyBytes[4];
 
-        static const InetAddress ANY;
-        static const InetAddress LOOPBACK;
-
     protected:
 
         mutable std::string hostname;
@@ -242,6 +239,10 @@ namespace net {
          */
         static unsigned int bytesToInt( const unsigned char* bytes, int start );
 
+        static InetAddress getAnyAddress();
+
+        static InetAddress getLoopbackAddress();
+
     };
 
 }}



Mime
View raw message