| 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 | { |