summaryrefslogtreecommitdiff
path: root/ACE/ace/Sock_Connect.cpp
diff options
context:
space:
mode:
authorjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-07-09 17:35:49 +0000
committerjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-07-09 17:35:49 +0000
commitefe6c6d05093b71ab015576573c00e70f6bae81a (patch)
treedab083e3adc7f7a57883189a7709f7d2c6e38f16 /ACE/ace/Sock_Connect.cpp
parentc818d22ca5e353b6e7714ad627fc19123331f7f1 (diff)
downloadATCD-efe6c6d05093b71ab015576573c00e70f6bae81a.tar.gz
ChangeLogTag: Wed Jul 9 16:09:30 UTC 2008 J.T. Conklin <jtc@acorntoolworks.com>
Diffstat (limited to 'ACE/ace/Sock_Connect.cpp')
-rw-r--r--ACE/ace/Sock_Connect.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/ACE/ace/Sock_Connect.cpp b/ACE/ace/Sock_Connect.cpp
index a182f5a714c..cad9402c1e1 100644
--- a/ACE/ace/Sock_Connect.cpp
+++ b/ACE/ace/Sock_Connect.cpp
@@ -189,50 +189,10 @@ ACE::bind_port (ACE_HANDLE handle, ACE_UINT32 ip_addr, int address_family)
addr.set ((u_short)0, ip_addr, 1, 1);
#endif /* ACE_HAS_IPV6 */
-#if !defined (ACE_LACKS_WILDCARD_BIND)
// The OS kernel should select a free port for us.
return ACE_OS::bind (handle,
(sockaddr*)addr.get_addr(),
addr.get_size());
-#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 (;;)
- {
- addr.set((u_short)upper_limit,ip_addr);
-
- if (ACE_OS::bind (handle,
- (sockaddr*)addr.get_addr()
- addr.get_size()) >= 0)
- {
-#if defined (ACE_WIN32)
- upper_limit--;
-#endif /* ACE_WIN32 */
- return 0;
- }
- else if (errno != EADDRINUSE)
- return -1;
- else
- {
- upper_limit--;
-
- // Wrap back around when we reach the bottom.
- if (upper_limit <= lower_limit)
- upper_limit = ACE_MAX_DEFAULT_PORT;
-
- // See if we have already gone around once!
- if (upper_limit == round_trip)
- {
- errno = EAGAIN;
- return -1;
- }
- }
- }
-#endif /* ACE_HAS_WILDCARD_BIND */
}
int