diff options
Diffstat (limited to 'ace/SOCK_Connector.cpp')
-rw-r--r-- | ace/SOCK_Connector.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/ace/SOCK_Connector.cpp b/ace/SOCK_Connector.cpp index 062df45f423..6006bef20c1 100644 --- a/ace/SOCK_Connector.cpp +++ b/ace/SOCK_Connector.cpp @@ -215,33 +215,24 @@ ACE_SOCK_Connector::complete (ACE_SOCK_Stream &new_stream, const ACE_Time_Value *tv) { ACE_TRACE ("ACE_SOCK_Connector::complete"); +#if defined (ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS) + // Win32 has a timing problem - if you check to see if the + // connection has completed too fast, it will fail - so wait + // <ACE_NON_BLOCKING_BUG_DELAY> microseconds to let it catch up. + ACE_Time_Value time (0, ACE_NON_BLOCKING_BUG_DELAY); + ACE_OS::sleep (time); +#endif /* ACE_HAS_BROKEN_NON_BLOCKING_CONNECTS */ ACE_HANDLE h = ACE::handle_timed_complete (new_stream.get_handle (), tv); // We failed to get connected. if (h == ACE_INVALID_HANDLE) { -#if defined (ACE_WIN32) - // Win32 has a timing problem - if you check to see if the - // connection has completed too fast, it will fail - so wait - // <ACE_NON_BLOCKING_BUG_DELAY> microseconds to let it catch up - // then retry to see if it's a real failure. - ACE_Time_Value time (0, ACE_NON_BLOCKING_BUG_DELAY); - ACE_OS::sleep (time); - h = ACE::handle_timed_complete (new_stream.get_handle (), - tv); - if (h == ACE_INVALID_HANDLE) - { -#endif /* ACE_WIN32 */ // Save/restore errno. ACE_Errno_Guard error (errno); new_stream.close (); return -1; -#if defined (ACE_WIN32) - } -#endif /* ACE_WIN32 */ } - - if (remote_sap != 0) + else if (remote_sap != 0) { int len = remote_sap->get_size (); sockaddr *addr = ACE_reinterpret_cast (sockaddr *, |