diff options
author | Matt Corallo <matt@bluematt.me> | 2012-06-28 18:32:32 +0200 |
---|---|---|
committer | Matt Corallo <matt@bluematt.me> | 2012-06-28 18:32:32 +0200 |
commit | 7cf3d2ccb960a1c8e81622d46b38cf253893d9af (patch) | |
tree | bd1d0fd80924ea58c59f88154e41b974a6962124 /src/bitcoinrpc.cpp | |
parent | 18c4beb05b494f30b16a17b834c23ec8774749b2 (diff) |
Use a rpc-specific queue to tell asio connections to shutdown.
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r-- | src/bitcoinrpc.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<void ()> StopRequests; + try { boost::shared_ptr<ip::tcp::acceptor> 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<void ()>( + StopRequests.connect(signals2::slot<void ()>( static_cast<void (ip::tcp::acceptor::*)()>(&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<void ()>( + StopRequests.connect(signals2::slot<void ()>( static_cast<void (ip::tcp::acceptor::*)()>(&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) |