コード例 #1
0
	void http_seed_connection::disconnect(error_code const& ec
		, operation_t op, int error)
	{
		if (is_disconnecting()) return;

		if (op == op_connect && m_web && !m_web->endpoints.empty())
		{
			// we failed to connect to this IP. remove it so that the next attempt
			// uses the next IP in the list.
			m_web->endpoints.erase(m_web->endpoints.begin());
		}

		boost::shared_ptr<torrent> t = associated_torrent().lock();
		peer_connection::disconnect(ec, op, error);
		if (t) t->disconnect_web_seed(this);
	}
コード例 #2
0
	void web_connection_base::start()
	{
		set_upload_only(true);
		if (is_disconnecting()) return;
		peer_connection::start();
	}