MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / GetNextLocalUDPEndpoint

Method GetNextLocalUDPEndpoint

libi2pd_client/SOCKS.cpp:906–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904 }
905
906 boost::asio::ip::udp::endpoint SOCKSServer::GetNextLocalUDPEndpoint ()
907 {
908 const auto& localEndpoint = GetLocalEndpoint ();
909 uint16_t port = localEndpoint.port ();
910#if __cplusplus >= 202002L // C++20
911 while (m_UDPPorts.contains (port))
912#else
913 while (m_UDPPorts.count (port) > 0)
914#endif
915 port++;
916 m_UDPPorts.insert (port);
917
918 return boost::asio::ip::udp::endpoint (localEndpoint.address (), port); // use proxy address
919 }
920
921 void SOCKSServer::ReleaseLocalUDPPort (uint16_t port)
922 {

Callers 1

HandleSockRecvMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected