GEODE-7209: Modify check if hostname is resolved (#521)
diff --git a/cppcache/src/PoolFactory.cpp b/cppcache/src/PoolFactory.cpp
index 9a5908f..b74fbd7 100644
--- a/cppcache/src/PoolFactory.cpp
+++ b/cppcache/src/PoolFactory.cpp
@@ -310,16 +310,8 @@
ACE_INET_Addr addr(port, host.c_str());
#ifdef WITH_IPV6
// check unknown host
- const int maxlength = 256;
- const int maxhostlength = 256;
- char char_array[maxlength];
- char char_localhost[maxhostlength];
-
- addr.get_host_name(char_array, maxlength);
- gethostname(char_localhost, maxhostlength); // get local hostname
-
- if ((strcmp(char_localhost, host.c_str()) != 0) &&
- (strcmp(char_localhost, char_array) == 0)) {
+ // ACE will not initialize port if hostname is not resolved.
+ if (port != addr.get_port_number()) {
#else
if (!(addr.get_ip_address())) {
#endif