Examples set reuse_address(true)

fix #1027
This commit is contained in:
Vinnie Falco
2018-02-21 12:35:07 -08:00
parent 490b9ce893
commit a4714746dc
18 changed files with 122 additions and 0 deletions
@@ -419,6 +419,14 @@ public:
return;
}
// Allow address reuse
acceptor_.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
{
fail(ec, "set_option");
return;
}
// Bind to the server address
acceptor_.bind(endpoint, ec);
if(ec)
@@ -380,6 +380,14 @@ public:
return;
}
// Allow address reuse
acceptor_.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
{
fail(ec, "set_option");
return;
}
// Bind to the server address
acceptor_.bind(endpoint, ec);
if(ec)
@@ -325,6 +325,11 @@ do_listen(
if(ec)
return fail(ec, "open");
// Allow address reuse
acceptor.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
return fail(ec, "set_option");
// Bind to the server address
acceptor.bind(endpoint, ec);
if(ec)
@@ -309,6 +309,11 @@ do_listen(
if(ec)
return fail(ec, "open");
// Allow address reuse
acceptor.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
return fail(ec, "set_option");
// Bind to the server address
acceptor.bind(endpoint, ec);
if(ec)
@@ -591,6 +591,14 @@ public:
return;
}
// Allow address reuse
acceptor_.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
{
fail(ec, "set_option");
return;
}
// Bind to the server address
acceptor_.bind(endpoint, ec);
if(ec)
@@ -405,6 +405,14 @@ public:
return;
}
// Allow address reuse
acceptor_.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
{
fail(ec, "set_option");
return;
}
// Bind to the server address
acceptor_.bind(endpoint, ec);
if(ec)
@@ -372,6 +372,14 @@ public:
return;
}
// Allow address reuse
acceptor_.set_option(boost::asio::socket_base::reuse_address(true));
if(ec)
{
fail(ec, "set_option");
return;
}
// Bind to the server address
acceptor_.bind(endpoint, ec);
if(ec)