Parcourir la 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 il y a 15 ans
Parent
commit
b6f569385a
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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,
         // Set v6-only (we use a different instantiation for v4,
         // otherwise asio will bind to both v4 and v6
         // otherwise asio will bind to both v4 and v6
         if (af == AF_INET6) {
         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_.bind(endpoint);
         acceptor_.listen();
         acceptor_.listen();
         acceptor_.async_accept(listening_->getSocket(),
         acceptor_.async_accept(listening_->getSocket(),