face: When there are no more events to process, pausing transport instead of closing it

Change-Id: I12ad55c6ef3b6b3fce4a5b3c679eb0c6dc3cfa07
Refs: #1314
diff --git a/src/face.cpp b/src/face.cpp
index 7d40345..fe509c4 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -86,6 +86,8 @@
   if (!m_transport->isConnected())
     m_transport->connect(*m_ioService,
                         bind(&Face::onReceiveElement, this, _1));
+  else if (!m_transport->isExpectingData())
+      m_transport->resume();
 
   shared_ptr<const Interest> interestToExpress(new Interest(interest));
 
@@ -194,7 +196,7 @@
   if (i != m_registeredPrefixTable.end())
     {
       m_fwController->selfDeregisterPrefix((*i)->getPrefix(),
-                                           bind(&Face::finalizeUnsertInterestFilter, this, i),
+                                           bind(&Face::finalizeUnsetInterestFilter, this, i),
                                            Controller::FailCallback());
     }
 
@@ -202,13 +204,13 @@
 }
 
 void
-Face::finalizeUnsertInterestFilter(RegisteredPrefixTable::iterator item)
+Face::finalizeUnsetInterestFilter(RegisteredPrefixTable::iterator item)
 {
   m_registeredPrefixTable.erase(item);
 
   if (!m_pitTimeoutCheckTimerActive && m_registeredPrefixTable.empty())
     {
-      m_transport->close();
+      m_transport->pause();
       if (!m_ioServiceWork) {
         m_processEventsTimeoutTimer->cancel();
       }
@@ -306,7 +308,7 @@
     m_pitTimeoutCheckTimerActive = false;
 
     if (m_registeredPrefixTable.empty()) {
-      m_transport->close();
+      m_transport->pause();
       if (!m_ioServiceWork) {
         m_processEventsTimeoutTimer->cancel();
       }