Browse Source

use REUSEADDR option for TCPServer
(also shorten the name space specification for the V6ONLY option)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1525 e5f2f494-b856-4b98-b285-d166d9295462

JINMEI Tatuya 15 years ago
parent
commit
b6f569385a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/bin/auth/main.cc

+ 2 - 1
src/bin/auth/main.cc

@@ -207,8 +207,9 @@ public:
         // Set v6-only (we use a different instantiation for v4,
         // otherwise asio will bind to both v4 and v6
         if (af == AF_INET6) {
-            acceptor_.set_option(boost::asio::ip::v6_only(true));
+            acceptor_.set_option(ip::v6_only(true));
         }
+        acceptor_.set_option(tcp::acceptor::reuse_address(true));
         acceptor_.bind(endpoint);
         acceptor_.listen();
         acceptor_.async_accept(listening_->getSocket(),