Fixes issue #875
Show error message instead of exception crash when unable to bind RPC port #1046
pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2012_04_rpcporterror changing 1 files +15 −3-
laanwj commented at 6:48 PM on April 5, 2012: member
-
gavinandresen commented at 7:12 PM on April 5, 2012: contributor
ACK
-
3e34352222
Show error message instead of exception crash when unable to bind RPC port
Fixes issue #875
-
in src/bitcoinrpc.cpp:None in 5c60de299f outdated
2383 | + ip::tcp::acceptor acceptor(io_service); 2384 | + try 2385 | + { 2386 | + acceptor.open(endpoint.protocol()); 2387 | + acceptor.bind(endpoint); 2388 | + acceptor.set_option(socket_base::reuse_address(true));
luke-jr commented at 4:22 PM on April 6, 2012:Why socket_base instead of boost::asio::ip::tcp::acceptor (as in current code)?
laanwj commented at 4:36 PM on April 6, 2012:boost itself uses socket_base::reuse_address internally, but that's fine with me too
in src/bitcoinrpc.cpp:None in 5c60de299f outdated
2382 | - acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); 2383 | + ip::tcp::acceptor acceptor(io_service); 2384 | + try 2385 | + { 2386 | + acceptor.open(endpoint.protocol()); 2387 | + acceptor.bind(endpoint);
luke-jr commented at 4:24 PM on April 6, 2012:Any reason not to bind after setting reuse_address (like boost itself does)?
laanwj commented at 4:34 PM on April 6, 2012:yes that would be more logical order
luke-jr commented at 7:08 PM on April 6, 2012: memberVisual ACK
jgarzik commented at 7:32 PM on April 10, 2012: contributorACK
laanwj referenced this in commit b56772e5df on Apr 10, 2012laanwj merged this on Apr 10, 2012laanwj closed this on Apr 10, 2012coblee referenced this in commit f5df100d90 on Jul 17, 2012laanwj deleted the branch on Apr 9, 2014suprnurd referenced this in commit 4316b4e277 on Dec 5, 2017sanch0panza referenced this in commit e19983c42d on May 17, 2018DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me