always use SO_REUSEADDR and deprecate the flag to turn it on

This commit is contained in:
Arvid Norberg 2012-06-28 06:51:18 +00:00
parent 426f555ce0
commit 4a2c799a1a
3 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,6 @@
* fix nagle implementation in uTP
* always use SO_REUSEADDR and deprecate the flag to turn it on
* add python bindings for SSL support
* minor uTP tweaks
* fix end-game mode issue when some files are selected to not be downloaded

View File

@ -329,7 +329,10 @@ namespace libtorrent
// the error. It will return true on success.
enum listen_on_flags_t
{
#ifndef TORRENT_NO_DEPRECATE
// this is always on starting with 0.16.2
listen_reuse_address = 0x01,
#endif
listen_no_system_port = 0x02
};

View File

@ -2083,11 +2083,10 @@ namespace aux {
#endif
return;
}
if (flags & session::listen_reuse_address)
{
error_code err; // ignore errors here
s->sock->set_option(socket_acceptor::reuse_address(true), err);
}
error_code err; // ignore errors here
s->sock->set_option(socket_acceptor::reuse_address(true), err);
#if TORRENT_USE_IPV6
if (ep.protocol() == tcp::v6())
{