aboutsummaryrefslogtreecommitdiff
path: root/libcmix-network
diff options
context:
space:
mode:
Diffstat (limited to 'libcmix-network')
-rw-r--r--libcmix-network/acceptor.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libcmix-network/acceptor.cpp b/libcmix-network/acceptor.cpp
index 896ed95..83406db 100644
--- a/libcmix-network/acceptor.cpp
+++ b/libcmix-network/acceptor.cpp
@@ -23,8 +23,12 @@ bool Acceptor::is_open() {
void Acceptor::listen_v6_and_v4_any() {
acceptor.open(endpoint.protocol());
- v6_only option(false);
- acceptor.set_option(option);
+
+ v6_only v6(false);
+ acceptor.set_option(v6);
+
+ boost::asio::socket_base::reuse_address reuse(true);
+ acceptor.set_option(reuse);
acceptor.bind(endpoint);
acceptor.listen();
@@ -33,6 +37,10 @@ void Acceptor::listen_v6_and_v4_any() {
void Acceptor::listen_socket()
{
acceptor.open(endpoint.protocol());
+
+ boost::asio::socket_base::reuse_address reuse(true);
+ acceptor.set_option(reuse);
+
acceptor.bind(endpoint);
acceptor.listen();
}