From: Michal 'vorner' Vaner Date: Tue, 6 Dec 2011 15:23:07 +0000 (+0100) Subject: [805] Simplify initialization X-Git-Tag: trac2351_base~304^2~15^2~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5345a3c2ba2daf9329b33984782ad50f72734837;p=thirdparty%2Fkea.git [805] Simplify initialization No need to create an opened socket and close it right away. --- diff --git a/src/lib/asiodns/udp_server.cc b/src/lib/asiodns/udp_server.cc index 69dcade4c8..a47e699e6a 100644 --- a/src/lib/asiodns/udp_server.cc +++ b/src/lib/asiodns/udp_server.cc @@ -83,9 +83,7 @@ struct UDPServer::Data { // We must use different instantiations for v4 and v6; // otherwise ASIO will bind to both udp proto = v6 ? udp::v6() : udp::v4(); - socket_.reset(new udp::socket(io_service, proto)); - // For some strange reason, without this, the assign throws an exception. - socket_->close(); + socket_.reset(new udp::socket(io_service)); socket_->assign(proto, fd); }