Browse Source

select appropritae address

pull/437/head
orignal 9 years ago
parent
commit
5befe1f019
  1. 12
      Transports.cpp

12
Transports.cpp

@ -375,6 +375,8 @@ namespace transport @@ -375,6 +375,8 @@ namespace transport
{
auto& peer = it1->second;
if (!ecode && peer.router)
{
while (it != boost::asio::ip::tcp::resolver::iterator())
{
auto address = (*it).endpoint ().address ();
LogPrint (eLogDebug, "Transports: ", (*it).host_name (), " has been resolved to ", address);
@ -387,9 +389,11 @@ namespace transport @@ -387,9 +389,11 @@ namespace transport
m_NTCPServer->Connect (address, addr->port, s);
return;
}
break;
}
else
LogPrint (eLogInfo, "Can't connect to NTCP ", address, " ipv6 is not supported");
LogPrint (eLogInfo, "Transports: NTCP ", address, " is not supported");
}
}
LogPrint (eLogError, "Transports: Unable to resolve NTCP address: ", ecode.message ());
std::unique_lock<std::mutex> l(m_PeersMutex);
@ -413,6 +417,8 @@ namespace transport @@ -413,6 +417,8 @@ namespace transport
{
auto& peer = it1->second;
if (!ecode && peer.router)
{
while (it != boost::asio::ip::tcp::resolver::iterator())
{
auto address = (*it).endpoint ().address ();
LogPrint (eLogDebug, "Transports: ", (*it).host_name (), " has been resolved to ", address);
@ -424,9 +430,11 @@ namespace transport @@ -424,9 +430,11 @@ namespace transport
m_SSUServer->CreateSession (peer.router, address, addr->port);
return;
}
break;
}
else
LogPrint (eLogInfo, "Can't connect to SSU ", address, " ipv6 is not supported");
LogPrint (eLogInfo, "Transports: SSU ", address, " is not supported");
}
}
LogPrint (eLogError, "Transports: Unable to resolve SSU address: ", ecode.message ());
std::unique_lock<std::mutex> l(m_PeersMutex);

Loading…
Cancel
Save