summaryrefslogtreecommitdiff
path: root/ace/ACE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/ACE.cpp')
-rw-r--r--ace/ACE.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 5bc9dd8d171..768d1af65e5 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -1551,9 +1551,6 @@ ACE::bind_port (ACE_HANDLE handle,
ACE_TRACE ("ACE::bind_port");
sockaddr_in sin;
- static u_short upper_limit = ACE_MAX_DEFAULT_PORT;
- int lower_limit = IPPORT_RESERVED;
- int round_trip = upper_limit;
ACE_OS::memset ((void *) &sin, 0, sizeof sin);
sin.sin_family = AF_INET;
@@ -1562,11 +1559,15 @@ ACE::bind_port (ACE_HANDLE handle,
#endif /* ACE_HAS_SIN_LEN */
sin.sin_addr.s_addr = ip_addr;
-#if defined (ACE_HAS_WILDCARD_BIND)
+#if !defined (ACE_LACKS_WILDCARD_BIND)
// The OS kernel should select a free port for us.
sin.sin_port = 0;
return ACE_OS::bind (handle, (sockaddr *) &sin, sizeof sin);
#else
+ static u_short upper_limit = ACE_MAX_DEFAULT_PORT;
+ int round_trip = upper_limit;
+ int lower_limit = IPPORT_RESERVED;
+
// We have to select the port explicitly.
for (;;)