fixed issue with failing async_accept on windows

This commit is contained in:
Arvid Norberg 2007-10-15 19:02:54 +00:00
parent a1356bdb7f
commit d0ef85e802
1 changed files with 13 additions and 0 deletions

View File

@ -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))
{