add options to not use ntcp or ssu

This commit is contained in:
Jeff Becker 2016-06-17 09:02:12 -04:00
parent fa68e392c8
commit e868d427dd
6 changed files with 22 additions and 13 deletions

View file

@ -105,7 +105,7 @@ namespace transport
Stop ();
}
void Transports::Start ()
void Transports::Start (bool enableNTCP, bool enableSSU)
{
m_DHKeysPairSupplier.Start ();
m_IsRunning = true;
@ -114,7 +114,7 @@ namespace transport
auto& addresses = context.GetRouterInfo ().GetAddresses ();
for (auto address : addresses)
{
if (!m_NTCPServer)
if (!m_NTCPServer && enableNTCP)
{
m_NTCPServer = new NTCPServer ();
m_NTCPServer->Start ();
@ -129,7 +129,7 @@ namespace transport
if (address->transportStyle == RouterInfo::eTransportSSU && address->host.is_v4 ())
{
if (!m_SSUServer)
if (!m_SSUServer && enableSSU)
{
m_SSUServer = new SSUServer (address->port);
LogPrint (eLogInfo, "Transports: Start listening UDP port ", address->port);