mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
check if we can send HolePunch to partcular address
This commit is contained in:
parent
22f9abc2f1
commit
dda25d431c
4 changed files with 23 additions and 1 deletions
|
@ -108,6 +108,21 @@ namespace transport
|
|||
else if (localAddress.is_v6 ())
|
||||
m_AddressV6 = localAddress;
|
||||
}
|
||||
|
||||
bool SSU2Server::IsSupported (const boost::asio::ip::address& addr) const
|
||||
{
|
||||
if (addr.is_v4 ())
|
||||
{
|
||||
if (m_SocketV4.is_open ())
|
||||
return true;
|
||||
}
|
||||
else if (addr.is_v6 ())
|
||||
{
|
||||
if (m_SocketV6.is_open ())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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