From 7cf3d2ccb960a1c8e81622d46b38cf253893d9af Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 28 Jun 2012 18:32:32 +0200 Subject: Use a rpc-specific queue to tell asio connections to shutdown. --- src/bitcoinrpc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 1874493391..82bab36dc8 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2858,6 +2858,8 @@ void ThreadRPCServer2(void* parg) asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any(); ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 8332)); + boost::signals2::signal StopRequests; + try { boost::shared_ptr acceptor(new ip::tcp::acceptor(io_service)); @@ -2873,7 +2875,7 @@ void ThreadRPCServer2(void* parg) RPCListen(acceptor, context, fUseSSL); // Cancel outstanding listen-requests for this acceptor when shutting down - uiInterface.QueueShutdown.connect(signals2::slot( + StopRequests.connect(signals2::slot( static_cast(&ip::tcp::acceptor::close), acceptor.get()) .track(acceptor)); @@ -2891,7 +2893,7 @@ void ThreadRPCServer2(void* parg) RPCListen(acceptor, context, fUseSSL); // Cancel outstanding listen-requests for this acceptor when shutting down - uiInterface.QueueShutdown.connect(signals2::slot( + StopRequests.connect(signals2::slot( static_cast(&ip::tcp::acceptor::close), acceptor.get()) .track(acceptor)); } @@ -2908,6 +2910,7 @@ void ThreadRPCServer2(void* parg) while (!fShutdown) io_service.run_one(); vnThreadsRunning[THREAD_RPCLISTENER]++; + StopRequests(); } void ThreadRPCServer3(void* parg) -- cgit v1.2.3