Commit 866ac6ab authored by Alexandros Konstantinakis-Karmis's avatar Alexandros Konstantinakis-Karmis Committed by Tatsuhiro Tsujikawa

add option reuse addr in local endpoint configuration of asio client

parent de4fd7cd
......@@ -40,7 +40,11 @@ session_tcp_impl::session_tcp_impl(
const std::string &host, const std::string &service,
const boost::posix_time::time_duration &connect_timeout)
: session_impl(io_service, connect_timeout),
socket_(io_service, local_endpoint) {}
socket_(io_service, tcp::v4()) {
boost::asio::socket_base::reuse_address option(true);
socket_.set_option(option);
socket_.bind(local_endpoint);
}
session_tcp_impl::~session_tcp_impl() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment