|
|
@ -283,10 +283,14 @@ namespace client |
|
|
|
void TCPIPAcceptor::Start () |
|
|
|
void TCPIPAcceptor::Start () |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_Acceptor.reset (new boost::asio::ip::tcp::acceptor (GetService (), m_LocalEndpoint)); |
|
|
|
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
|
|
|
|
// update the local end point in case port has been set zero and got updated now
|
|
|
|
m_LocalEndpoint = m_Acceptor->local_endpoint(); |
|
|
|
m_LocalEndpoint = m_Acceptor->local_endpoint(); |
|
|
|
|
|
|
|
try { |
|
|
|
m_Acceptor->listen (); |
|
|
|
m_Acceptor->listen (); |
|
|
|
Accept (); |
|
|
|
Accept (); |
|
|
|
|
|
|
|
} catch (std::exception& ex) { |
|
|
|
|
|
|
|
LogPrint (eLogError, "I2PService: failed to start ", GetName(), " acceptor: ", ex.what ()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TCPIPAcceptor::Stop () |
|
|
|
void TCPIPAcceptor::Stop () |
|
|
|