From c730839989d3d00d70c649226ecf92530985fba0 Mon Sep 17 00:00:00 2001 From: Veggie Monster Date: Mon, 22 Jan 2018 20:47:31 -0500 Subject: [PATCH] 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() --- libi2pd_client/I2PService.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libi2pd_client/I2PService.cpp b/libi2pd_client/I2PService.cpp index 6fd5d763..21e1fdfa 100644 --- a/libi2pd_client/I2PService.cpp +++ b/libi2pd_client/I2PService.cpp @@ -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 (); }