Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db5eb39

Browse filesBrowse files
AdminAdmin
Admin
authored and
Admin
committed
disable SO_REUSEADDR on windows due to it causing undefined behaviour when binding to the same existing server port
1 parent e031fa7 commit db5eb39
Copy full SHA for db5eb39

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎lib/rpc/server.cc

Copy file name to clipboardExpand all lines: lib/rpc/server.cc
+4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ struct server::impl {
3232
suppress_exceptions_(false) {
3333
auto ep = tcp::endpoint(ip::address::from_string(address), port);
3434
acceptor_.open(ep.protocol());
35+
#ifndef _WIN32
3536
acceptor_.set_option(tcp::acceptor::reuse_address(true));
37+
#endif // !_WIN32
3638
acceptor_.bind(ep);
3739
acceptor_.listen();
3840
}
@@ -45,7 +47,9 @@ struct server::impl {
4547
suppress_exceptions_(false) {
4648
auto ep = tcp::endpoint(tcp::v4(), port);
4749
acceptor_.open(ep.protocol());
50+
#ifndef _WIN32
4851
acceptor_.set_option(tcp::acceptor::reuse_address(true));
52+
#endif // !_WIN32
4953
acceptor_.bind(ep);
5054
acceptor_.listen();
5155
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.