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 4a26b74517c..2b49dffc42b 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -823,7 +823,8 @@ ACE::bind_port (ACE_HANDLE handle)
sockaddr_in sin;
// This should be a constant, so I hope they never change the number
// of bits in a port number!
- static u_short upper_limit = ACE_MAX_DEFAULT_PORT;
+ const u_short MAX_SHORT = 65535;
+ static u_short upper_limit = MAX_SHORT;
int lower_limit = IPPORT_RESERVED;
int round_trip = upper_limit;
@@ -846,11 +847,11 @@ ACE::bind_port (ACE_HANDLE handle)
{
upper_limit--;
- // Wrap back around when we reach the bottom.
+ /* Wrap back around when we reach the bottom. */
if (upper_limit <= lower_limit)
- upper_limit = ACE_MAX_DEFAULT_PORT;
+ upper_limit = MAX_SHORT;
- // See if we have already gone around once!
+ /* See if we have already gone around once! */
if (upper_limit == round_trip)
{
errno = EAGAIN;