face: Remove unnecessary use of DNS resolver in (Udp|Tcp|WebSocket)Factory
Change-Id: Idbc743fe4c7d567a09acccef98fe6de26f8295f0
Refs: #2422
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 4ef4e17..fcf1343 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -26,7 +26,6 @@
#include "udp-factory.hpp"
#include "core/global-io.hpp"
#include "core/network-interface.hpp"
-#include <ndn-cxx/util/dns.hpp>
#if defined(__linux__)
#include <sys/socket.h>
@@ -136,13 +135,13 @@
}
shared_ptr<UdpChannel>
-UdpFactory::createChannel(const std::string& localHost,
+UdpFactory::createChannel(const std::string& localIp,
const std::string& localPort,
const time::seconds& timeout)
{
- udp::Endpoint endPoint(ndn::dns::syncResolve(localHost, getGlobalIoService()),
- boost::lexical_cast<uint16_t>(localPort));
- return createChannel(endPoint, timeout);
+ using namespace boost::asio::ip;
+ udp::Endpoint endpoint(address::from_string(localIp), boost::lexical_cast<uint16_t>(localPort));
+ return createChannel(endpoint, timeout);
}
shared_ptr<MulticastUdpFace>
@@ -253,10 +252,11 @@
const std::string& multicastPort,
const std::string& networkInterfaceName /* "" */)
{
- udp::Endpoint localEndpoint(ndn::dns::syncResolve(localIp, getGlobalIoService()),
+ using namespace boost::asio::ip;
+ udp::Endpoint localEndpoint(address::from_string(localIp),
boost::lexical_cast<uint16_t>(multicastPort));
- udp::Endpoint multicastEndpoint(ndn::dns::syncResolve(multicastIp, getGlobalIoService()),
+ udp::Endpoint multicastEndpoint(address::from_string(multicastIp),
boost::lexical_cast<uint16_t>(multicastPort));
return createMulticastFace(localEndpoint, multicastEndpoint, networkInterfaceName);