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 2010/07/16 19:56:56 UTC
svn commit: r964888 - in
/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net:
InetAddress.cpp InetAddress.h
Author: tabish
Date: Fri Jul 16 17:56:56 2010
New Revision: 964888
URL: http://svn.apache.org/viewvc?rev=964888&view=rev
Log:
fix for: https://issues.apache.org/activemq/browse/AMQCPP-303
Modified:
activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.cpp
activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.h
Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.cpp?rev=964888&r1=964887&r2=964888&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.cpp (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.cpp Fri Jul 16 17:56:56 2010
@@ -36,9 +36,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() {
}
@@ -154,7 +151,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;
@@ -188,3 +185,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/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.h?rev=964888&r1=964887&r2=964888&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.h (original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/decaf/net/InetAddress.h Fri Jul 16 17:56: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;
@@ -234,6 +231,10 @@ namespace net {
*/
static unsigned int bytesToInt( const unsigned char* bytes, int start );
+ static InetAddress getAnyAddress();
+
+ static InetAddress getLoopbackAddress();
+
};
}}