fixed issue with failing async_accept on windows
This commit is contained in:
parent
a1356bdb7f
commit
d0ef85e802
|
@ -89,6 +89,10 @@ namespace
|
|||
} openssl_global_destructor;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
// for ERROR_SEM_TIMEOUT
|
||||
#include <winerror.h>
|
||||
#endif
|
||||
|
||||
using boost::shared_ptr;
|
||||
|
@ -924,6 +928,15 @@ namespace detail
|
|||
std::string msg = "error accepting connection on '"
|
||||
+ boost::lexical_cast<std::string>(ep) + "' " + e.message();
|
||||
(*m_logger) << msg << "\n";
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
// Windows sometimes generates this error. It seems to be
|
||||
// non-fatal and we have to do another async_accept.
|
||||
if (e.value() == ERROR_SEM_TIMEOUT)
|
||||
{
|
||||
async_accept(listener);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (m_alerts.should_post(alert::fatal))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue