build: Fix compilation errors and deprecation warnings

Change-Id: Ibbe2d30ced038f0c46a8669b5957b68c4f265350
diff --git a/src/sync-interest-table.cc b/src/sync-interest-table.cc
index 16706ea..f62d946 100644
--- a/src/sync-interest-table.cc
+++ b/src/sync-interest-table.cc
@@ -32,8 +32,8 @@
   : m_entryLifetime (lifetime)
   , m_scheduler(io)
 {
-  m_scheduler.schedulePeriodicEvent (ndn::time::seconds (4), ndn::time::seconds (4),
-                                     ndn::bind(&SyncInterestTable::expireInterests, this));
+  m_scheduler.scheduleEvent(ndn::time::seconds (4),
+                            ndn::bind(&SyncInterestTable::expireInterests, this));
 }
 
 SyncInterestTable::~SyncInterestTable ()
@@ -116,6 +116,9 @@
       else
         break;
   }
+
+  m_scheduler.scheduleEvent(ndn::time::seconds (4),
+                            ndn::bind(&SyncInterestTable::expireInterests, this));
 }
 
 
diff --git a/src/sync-intro-certificate.h b/src/sync-intro-certificate.h
index bc19fd2..737c921 100644
--- a/src/sync-intro-certificate.h
+++ b/src/sync-intro-certificate.h
@@ -106,7 +106,7 @@
   // Naming convention /<sync_prefix>/CHRONOS-INTRO-CERT/introducee_certname/introducer_certname/version
   ndn::Name dataName = data.getName();
 
-  if(dataName.size() < 4 || dataName.get(-4).toEscapedString() != "CHRONOS-INTRO-CERT")
+  if(dataName.size() < 4 || dataName.get(-4).toUri() != "CHRONOS-INTRO-CERT")
     throw Error("Not a Sync::IntroCertificate");
 
   try
diff --git a/src/sync-socket.cc b/src/sync-socket.cc
index b18f64c..adecec3 100644
--- a/src/sync-socket.cc
+++ b/src/sync-socket.cc
@@ -49,7 +49,7 @@
   , m_newDataCallback(dataCallback)
   , m_myCertificate(myCertificate)
   , m_face(face)
-  , m_ioService(face->ioService())
+  , m_ioService(face->getIoService())
 {
   if(withRoutingPrefix && !routingPrefix.isPrefixOf(m_dataPrefix))
     {
@@ -93,8 +93,8 @@
   data->setContent(reinterpret_cast<const uint8_t*>(buf), len);
   data->setFreshnessPeriod(time::milliseconds(1000*freshness));
 
-  m_ioService->post(bind(&SyncSocket::publishDataInternal, this,
-                         data, isCert));
+  m_ioService.post(bind(&SyncSocket::publishDataInternal, this,
+                        data, isCert));
 }
 
 void
@@ -164,7 +164,7 @@
   for(; it != end; it++)
     {
       offset--;
-      if(it->toEscapedString() == "%F0.")
+      if(it->toUri() == "%F0.")
         {
           encaped = true;
           break;
@@ -215,7 +215,7 @@
                             const OnDataValidated& onValidated)
 {
   if(data->getName().size() > interestNameSize
-     && data->getName().get(interestNameSize).toEscapedString() == "INTRO-CERT")
+     && data->getName().get(interestNameSize).toUri() == "INTRO-CERT")
     {
       if(!m_withSecurity)
         return;
diff --git a/src/sync-socket.h b/src/sync-socket.h
index abf1dfa..3dcef9e 100644
--- a/src/sync-socket.h
+++ b/src/sync-socket.h
@@ -189,7 +189,7 @@
   ndn::IdentityCertificate m_myCertificate;
   ndn::KeyChain m_keyChain;
   ndn::shared_ptr<ndn::Face> m_face;
-  ndn::shared_ptr<boost::asio::io_service> m_ioService;
+  boost::asio::io_service& m_ioService;
   bool m_withSecurity;
   ndn::shared_ptr<ndn::Validator> m_syncValidator;
   ndn::shared_ptr<SyncLogic>      m_syncLogic;