1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-21 23:54:14 +00:00

the change allows when an TCPIPAcceptor is constructed by setting port = 0, the random port chosen by asio can be retrieved using TCPIPAcceptor::GetLocalEndpoint().port()

This commit is contained in:
Veggie Monster 2018-01-22 20:47:31 -05:00
parent e630b8f8a8
commit c730839989

View File

@ -280,6 +280,8 @@ namespace client
void TCPIPAcceptor::Start ()
{
m_Acceptor.reset (new boost::asio::ip::tcp::acceptor (GetService (), m_LocalEndpoint));
//update the local end point in case port has been set zero and got updated now
m_LocalEndpoint = m_Acceptor->local_endpoint();
m_Acceptor->listen ();
Accept ();
}