remove uTP delayed ack and instead send acks when the udp socket has been drained. simplify the udp socket to use null_buffers and allocate less memory for buffers. this also eliminated the race condition when resizing the udp socket receive buffer which greatly simplified it

This commit is contained in:
Arvid Norberg
2012-06-21 15:05:57 +00:00
parent 3c0e7e0a4a
commit 2b9b2a188a
10 changed files with 189 additions and 252 deletions

View File

@@ -644,6 +644,7 @@ namespace aux {
, m_udp_socket(m_io_service
, boost::bind(&session_impl::on_receive_udp, this, _1, _2, _3, _4)
, boost::bind(&session_impl::on_receive_udp_hostname, this, _1, _2, _3, _4)
, boost::bind(&session_impl::on_udp_socket_drained, this)
, m_half_open)
, m_utp_socket_manager(m_settings, m_udp_socket
, boost::bind(&session_impl::incoming_connection, this, _1))
@@ -2500,6 +2501,14 @@ namespace aux {
}
}
// this is called every time all packets have been read from
// the udp socket. The utp_socket_manager uses this event to
// trigger a flush of deferred ACKs
void session_impl::on_udp_socket_drained()
{
m_utp_socket_manager.socket_drained();
}
void session_impl::async_accept(boost::shared_ptr<socket_acceptor> const& listener, bool ssl)
{
TORRENT_ASSERT(!m_abort);