diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index a983db6..246cdb0 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -154,9 +154,10 @@
 
     NFD_LOG_DEBUG("Connect to remote endpoint failed: "
                   << error.category().message(error.value()));
-    
-    onAcceptFailed("Connect to remote endpoint failed: " +
-                   error.category().message(error.value()));
+
+    if (static_cast<bool>(onAcceptFailed))
+      onAcceptFailed("Connect to remote endpoint failed: " +
+                     error.category().message(error.value()));
     return;
   }
 
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 45b1a48..0994719 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -7,6 +7,9 @@
 #include "tcp-factory.hpp"
 #include "core/global-io.hpp"
 #include "core/resolver.hpp"
+#include "core/logger.hpp"
+
+NFD_LOG_INIT("TcpFactory");
 
 namespace nfd {
 
@@ -24,23 +27,14 @@
 
   channel = make_shared<TcpChannel>(boost::ref(getGlobalIoService()), boost::cref(endpoint));
   m_channels[endpoint] = channel;
+  NFD_LOG_DEBUG("Channel [" << endpoint << "] created");
   return channel;
 }
 
 shared_ptr<TcpChannel>
 TcpFactory::createChannel(const std::string& localHost, const std::string& localPort)
 {
-  using boost::asio::ip::tcp;
-
-  tcp::resolver::query query(localHost, localPort);
-  tcp::resolver resolver(getGlobalIoService());
-
-  tcp::resolver::iterator end;
-  tcp::resolver::iterator i = resolver.resolve(query);
-  if (i == end)
-    return shared_ptr<TcpChannel>();
-
-  return createChannel(*i);
+  return createChannel(TcpResolver::syncResolve(localHost, localPort));
 }
 
 shared_ptr<TcpChannel>
@@ -64,13 +58,12 @@
   else if (uri.getScheme() == "tcp6")
     addressSelector = resolver::Ipv6Address();
 
-  using boost::asio::ip::tcp;
-  Resolver<tcp>::asyncResolve(uri.getDomain(),
-                              uri.getPort().empty() ? m_defaultPort : uri.getPort(),
-                              bind(&TcpFactory::continueCreateFaceAfterResolve, this, _1,
-                                   onCreated, onConnectFailed),
-                              onConnectFailed,
-                              addressSelector);
+  TcpResolver::asyncResolve(uri.getDomain(),
+                            uri.getPort().empty() ? m_defaultPort : uri.getPort(),
+                            bind(&TcpFactory::continueCreateFaceAfterResolve, this, _1,
+                                 onCreated, onConnectFailed),
+                            onConnectFailed,
+                            addressSelector);
 }
 
 void
@@ -95,5 +88,4 @@
                   + boost::lexical_cast<std::string>(endpoint));
 }
 
-
 } // namespace nfd
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 1886f24..6ba2e37 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -54,7 +54,7 @@
    *
    * Note that this call will **BLOCK** until resolution is done or failed.
    *
-   * \throws TcpFactory::Error
+   * \throws TcpFactory::Error or std::runtime_error
    */
   shared_ptr<TcpChannel>
   createChannel(const std::string& localHost, const std::string& localPort);
diff --git a/tests/face/tcp.cpp b/tests/face/tcp.cpp
index b601be2..ff5dc50 100644
--- a/tests/face/tcp.cpp
+++ b/tests/face/tcp.cpp
@@ -18,11 +18,11 @@
 BOOST_AUTO_TEST_CASE(ChannelMap)
 {
   TcpFactory factory;
-  
+
   shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel1a = factory.createChannel("127.0.0.1", "20070");
   BOOST_CHECK_EQUAL(channel1, channel1a);
-  
+
   shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
   BOOST_CHECK_NE(channel1, channel2);
 }
@@ -39,7 +39,7 @@
       bind(&EndToEndFixture::face1_onReceiveInterest, this, _1);
     m_face1->onReceiveData +=
       bind(&EndToEndFixture::face1_onReceiveData, this, _1);
-    m_face1->onFail += 
+    m_face1->onFail +=
       bind(&EndToEndFixture::face1_onFail, this);
 
     this->afterIo();
@@ -52,7 +52,7 @@
 
     this->afterIo();
   }
-  
+
   void
   face1_onReceiveInterest(const Interest& interest)
   {
@@ -60,7 +60,7 @@
 
     this->afterIo();
   }
-  
+
   void
   face1_onReceiveData(const Data& data)
   {
@@ -85,7 +85,7 @@
       bind(&EndToEndFixture::face2_onReceiveInterest, this, _1);
     m_face2->onReceiveData +=
       bind(&EndToEndFixture::face2_onReceiveData, this, _1);
-    m_face2->onFail += 
+    m_face2->onFail +=
       bind(&EndToEndFixture::face2_onFail, this);
 
     this->afterIo();
@@ -98,7 +98,7 @@
 
     this->afterIo();
   }
-  
+
   void
   face2_onReceiveInterest(const Interest& interest)
   {
@@ -106,7 +106,7 @@
 
     this->afterIo();
   }
-  
+
   void
   face2_onReceiveData(const Data& data)
   {
@@ -142,14 +142,14 @@
   {
     BOOST_CHECK_EQUAL(m_faces.size(), shouldBe);
   }
-  
+
   void
   abortTestCase(const std::string& message)
   {
     g_io.stop();
     BOOST_FAIL(message);
   }
-  
+
 private:
   void
   afterIo()
@@ -180,13 +180,13 @@
     scheduler::schedule(time::seconds(10),
                         bind(&EndToEndFixture::abortTestCase, this,
                              "TcpChannel error: cannot connect or cannot accept connection"));
-  
+
   shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-  
+
   channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-  
+
   channel2->connect("127.0.0.1", "20070",
                     bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
                     bind(&EndToEndFixture::channel2_onConnectFailed, this, _1),
@@ -207,7 +207,7 @@
   BOOST_CHECK_EQUAL(static_cast<bool>(dynamic_pointer_cast<LocalFace>(m_face2)), true);
 
   // integrated tests needs to check that TcpFace for non-loopback fails these tests...
-  
+
   abortEvent =
     scheduler::schedule(time::seconds(10),
                         bind(&EndToEndFixture::abortTestCase, this,
@@ -222,11 +222,11 @@
 
   ndn::SignatureSha256WithRsa fakeSignature;
   fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue, reinterpret_cast<const uint8_t*>(0), 0));
-  
+
   // set fake signature on data1 and data2
   data1.setSignature(fakeSignature);
   data2.setSignature(fakeSignature);
-  
+
   m_face1->sendInterest(interest1);
   m_face1->sendData    (data1    );
   m_face2->sendInterest(interest2);
@@ -241,7 +241,7 @@
   BOOST_REQUIRE_EQUAL(m_face1_receivedDatas    .size(), 1);
   BOOST_REQUIRE_EQUAL(m_face2_receivedInterests.size(), 1);
   BOOST_REQUIRE_EQUAL(m_face2_receivedDatas    .size(), 1);
-  
+
   BOOST_CHECK_EQUAL(m_face1_receivedInterests[0].getName(), interest2.getName());
   BOOST_CHECK_EQUAL(m_face1_receivedDatas    [0].getName(), data2.getName());
   BOOST_CHECK_EQUAL(m_face2_receivedInterests[0].getName(), interest1.getName());
@@ -256,13 +256,13 @@
     scheduler::schedule(time::seconds(10),
                         bind(&EndToEndFixture::abortTestCase, this,
                              "TcpChannel error: cannot connect or cannot accept connection"));
-  
+
   shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-  
+
   channel1->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
-  
+
   channel2->connect("127.0.0.1", "20070",
                     bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
                     bind(&EndToEndFixture::channel_onConnectFailed, this, _1),
@@ -274,7 +274,7 @@
   scheduler::cancel(abortEvent);
 
   BOOST_CHECK_EQUAL(m_faces.size(), 2);
-  
+
   shared_ptr<TcpChannel> channel3 = factory.createChannel("127.0.0.1", "20072");
   channel3->connect("127.0.0.1", "20070",
                     bind(&EndToEndFixture::channel_onFaceCreated, this, _1),
@@ -285,7 +285,7 @@
   shared_ptr<TcpChannel> channel4 = factory.createChannel("127.0.0.1", "20073");
 
   BOOST_CHECK_NE(channel3, channel4);
-  
+
   scheduler
     ::schedule
     (time::seconds(1),
@@ -297,16 +297,16 @@
           static_cast<TcpChannel::ConnectFailedCallback>(bind(&EndToEndFixture::
                                                               channel_onConnectFailed, this, _1)),
           time::seconds(4)));
-  
+
   m_ioRemaining = 4; // 2 connects and 2 accepts
-  abortEvent = 
+  abortEvent =
     scheduler::schedule(time::seconds(10),
                         bind(&EndToEndFixture::abortTestCase, this,
                              "TcpChannel error: cannot connect or cannot accept multiple connections"));
 
   scheduler::schedule(time::seconds(0.5),
                       bind(&EndToEndFixture::checkFaceList, this, 4));
-  
+
   g_io.run();
   g_io.reset();
   scheduler::cancel(abortEvent);
@@ -323,13 +323,13 @@
     scheduler::schedule(time::seconds(10),
                         bind(&EndToEndFixture::abortTestCase, this,
                              "TcpChannel error: cannot connect or cannot accept connection"));
-  
+
   shared_ptr<TcpChannel> channel1 = factory.createChannel("127.0.0.1", "20070");
   shared_ptr<TcpChannel> channel2 = factory.createChannel("127.0.0.1", "20071");
-  
+
   channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
-  
+
   channel2->connect("127.0.0.1", "20070",
                     bind(&EndToEndFixture::channel2_onFaceCreated, this, _1),
                     bind(&EndToEndFixture::channel2_onConnectFailed, this, _1),
@@ -355,7 +355,7 @@
   m_ioRemaining = 2;
   // just double check that we are calling the virtual method
   static_pointer_cast<Face>(m_face1)->close();
-  
+
   BOOST_REQUIRE_NO_THROW(g_io.run());
   g_io.reset();
   scheduler::cancel(abortEvent);
@@ -363,7 +363,7 @@
   // both faces should get closed
   BOOST_CHECK(!static_cast<bool>(m_face1));
   BOOST_CHECK(!static_cast<bool>(m_face2));
-  
+
   BOOST_CHECK_EQUAL(channel1->size(), 0);
   BOOST_CHECK_EQUAL(channel2->size(), 0);
 }
