windows vista detection to set the default half-open connection limit even lower

This commit is contained in:
Arvid Norberg 2007-10-15 01:15:58 +00:00
parent ac6cc4c75c
commit 282edb5861
1 changed files with 13 additions and 2 deletions

View File

@ -569,8 +569,19 @@ namespace detail
, m_checker_impl(*this) , m_checker_impl(*this)
{ {
#ifdef WIN32 #ifdef WIN32
// windows XP has a limit of 10 simultaneous connections // windows XP has a limit on the number of
m_half_open.limit(8); // simultaneous half-open TCP connections
DWORD windows_version = ::GetVersion();
if ((windows_version & 0xff) >= 6)
{
// on vista the limit is 5 (in home edition)
m_half_open.limit(4);
}
else
{
// on XP SP2 it's 10
m_half_open.limit(8);
}
#endif #endif
m_bandwidth_manager[peer_connection::download_channel] = &m_download_channel; m_bandwidth_manager[peer_connection::download_channel] = &m_download_channel;