rpc: Add acceptors only when listening succeeded
Rebased-From: 6afa493
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
This commit is contained in:
parent
c7d61f3d4b
commit
9a6ff623fe
|
@ -602,7 +602,6 @@ void StartRPCThreads()
|
|||
try
|
||||
{
|
||||
boost::shared_ptr<ip::tcp::acceptor> acceptor(new ip::tcp::acceptor(*rpc_io_service));
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
acceptor->open(endpoint.protocol());
|
||||
acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
|
||||
|
||||
|
@ -614,6 +613,7 @@ void StartRPCThreads()
|
|||
|
||||
RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
|
||||
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
fListening = true;
|
||||
}
|
||||
catch(boost::system::system_error &e)
|
||||
|
@ -628,7 +628,6 @@ void StartRPCThreads()
|
|||
endpoint.address(bindAddress);
|
||||
|
||||
boost::shared_ptr<ip::tcp::acceptor> acceptor(new ip::tcp::acceptor(*rpc_io_service));
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
acceptor->open(endpoint.protocol());
|
||||
acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
|
||||
acceptor->bind(endpoint);
|
||||
|
@ -636,6 +635,7 @@ void StartRPCThreads()
|
|||
|
||||
RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
|
||||
|
||||
rpc_acceptors.push_back(acceptor);
|
||||
fListening = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue