forked from premiere/premiere-libtorrent
graceful shutdown of uTP sockets
This commit is contained in:
parent
dce8b3cc1a
commit
1a32205944
|
@ -82,6 +82,7 @@ namespace libtorrent
|
||||||
|
|
||||||
void mtu_for_dest(address const& addr, int& link_mtu, int& utp_mtu);
|
void mtu_for_dest(address const& addr, int& link_mtu, int& utp_mtu);
|
||||||
void set_sock_buf(int size);
|
void set_sock_buf(int size);
|
||||||
|
int num_sockets() const { return m_utp_sockets.size(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
udp_socket& m_sock;
|
udp_socket& m_sock;
|
||||||
|
|
|
@ -2902,7 +2902,16 @@ namespace aux {
|
||||||
#if defined TORRENT_VERBOSE_LOGGING
|
#if defined TORRENT_VERBOSE_LOGGING
|
||||||
// (*m_logger) << time_now_string() << " session_impl::on_tick\n";
|
// (*m_logger) << time_now_string() << " session_impl::on_tick\n";
|
||||||
#endif
|
#endif
|
||||||
if (m_abort) return;
|
|
||||||
|
// we have to keep ticking the utp socket manager
|
||||||
|
// until they're all closed
|
||||||
|
if (m_abort && m_utp_socket_manager.num_sockets() == 0)
|
||||||
|
{
|
||||||
|
#if defined TORRENT_ASIO_DEBUGGING
|
||||||
|
fprintf(stderr, "uTP sockets left: %d\n", m_utp_socket_manager.num_sockets());
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (e == asio::error::operation_aborted) return;
|
if (e == asio::error::operation_aborted) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue