refactored socket reading code to not use async. operations unnecessarily

This commit is contained in:
Arvid Norberg
2010-06-18 04:43:20 +00:00
parent 26c4a819c8
commit b882914461
7 changed files with 110 additions and 78 deletions

View File

@@ -165,6 +165,7 @@ namespace libtorrent
i != m_queue.end(); ++i)
{
if (i->connecting) ++num_connecting;
else TORRENT_ASSERT(i->expires == max_time());
}
TORRENT_ASSERT(num_connecting == m_num_connecting);
}
@@ -198,7 +199,7 @@ namespace libtorrent
while (i != m_queue.end())
{
TORRENT_ASSERT(i->connecting == false);
ptime expire = time_now() + i->timeout;
ptime expire = time_now_hires() + i->timeout;
if (m_num_connecting == 0)
{
error_code ec;
@@ -262,7 +263,7 @@ namespace libtorrent
if (e) return;
ptime next_expire = max_time();
ptime now = time_now();
ptime now = time_now_hires() + milliseconds(100);
std::list<entry> timed_out;
for (std::list<entry>::iterator i = m_queue.begin();
!m_queue.empty() && i != m_queue.end();)