Exemplo n.º 1
0
	void session::init(std::pair<int, int> listen_range, char const* listen_interface
		, fingerprint const& id, int flags, boost::uint32_t alert_mask TORRENT_LOGPATH_ARG)
	{
		m_impl.reset(new session_impl(listen_range, id, listen_interface, alert_mask TORRENT_LOGPATH));

#ifdef TORRENT_MEMDEBUG
		start_malloc_debug();
#endif
#ifndef TORRENT_DISABLE_EXTENSIONS
		if (flags & add_default_plugins)
		{
			add_extension(create_ut_pex_plugin);
			add_extension(create_ut_metadata_plugin);
			add_extension(create_lt_trackers_plugin);
			add_extension(create_smart_ban_plugin);
		}
#endif

		m_impl->start_session();

		if (flags & start_default_features)
		{
			start_upnp();
			start_natpmp();
#ifndef TORRENT_DISABLE_DHT
			start_dht();
#endif
			start_lsd();
		}
	}
Exemplo n.º 2
0
	void session::init(std::pair<int, int> listen_range, char const* listen_interface
		, fingerprint const& id, boost::uint32_t alert_mask)
	{
		m_impl.reset(new session_impl(listen_range, id, listen_interface, alert_mask));

#ifdef TORRENT_MEMDEBUG
		start_malloc_debug();
#endif
	}
Exemplo n.º 3
0
	void session::init(CLevelDB &swarmDb, std::pair<int, int> listen_range, char const* listen_interface
		, fingerprint const& id, boost::uint32_t alert_mask, char const* ext_ip)
	{
#if defined _MSC_VER && defined TORRENT_DEBUG
		// workaround for microsofts
		// hardware exceptions that makes
		// it hard to debug stuff
		::_set_se_translator(straight_to_debugger);
#endif

		m_impl.reset(new session_impl(swarmDb, listen_range, id, listen_interface, alert_mask, ext_ip));

#ifdef TORRENT_MEMDEBUG
		start_malloc_debug();
#endif
	}
Exemplo n.º 4
0
	void session::init(ns3::Ptr<Node> node, ns3::Ipv4Address ip, std::pair<int, int> listen_range, char const* listen_interface
		, fingerprint const& id, int flags, boost::uint32_t alert_mask TORRENT_LOGPATH_ARG)
	{
        NS_LOG_FUNCTION(this);
        ns3::Callback<void> initCallback = MakeCallback(&session::initCallback, this);
		m_impl.reset(new session_impl(initCallback, node, ip, listen_range, id, listen_interface, alert_mask TORRENT_LOGPATH));

#ifdef TORRENT_MEMDEBUG
		start_malloc_debug();
#endif

		m_impl->start_session();

		if (flags & start_default_features)
		{
		//	start_upnp();
		//	start_natpmp();
		}
	}