mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
recgnize symmetric NAT from SSU2
This commit is contained in:
parent
98d2ce5845
commit
ed5c533982
7 changed files with 63 additions and 16 deletions
|
@ -155,6 +155,14 @@ namespace transport
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t SSU2Server::GetPort (bool v4) const
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
boost::asio::ip::udp::endpoint ep = v4 ? m_SocketV4.local_endpoint (ec) : m_SocketV6.local_endpoint (ec);
|
||||
if (ec) return 0;
|
||||
return ep.port ();
|
||||
}
|
||||
|
||||
boost::asio::ip::udp::socket& SSU2Server::OpenSocket (const boost::asio::ip::udp::endpoint& localEndpoint)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue