diff --git a/src/transport/transport.cpp b/src/transport/transport.cpp
deleted file mode 100644
index 4d5db21..0000000
--- a/src/transport/transport.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#include <stdexcept>
-#include <ndn-cpp/transport/transport.hpp>
-
-using namespace std;
-
-namespace ndn {
-
-void 
-Transport::close()
-{
-}
-
-Transport::~Transport()
-{
-}
-
-}
diff --git a/src/transport/unix-transport.cpp b/src/transport/unix-transport.cpp
index 603f5e3..811e0d4 100644
--- a/src/transport/unix-transport.cpp
+++ b/src/transport/unix-transport.cpp
@@ -15,7 +15,7 @@
 #include <boost/bind.hpp>
 
 using namespace std;
-typedef boost::asio::local::datagram_protocol protocol;
+typedef boost::asio::local::stream_protocol protocol;
 
 namespace ndn {
 
@@ -24,67 +24,77 @@
 class UnixTransport::Impl
 {
 public:
-  Impl() : socket_(io_)
+  Impl(UnixTransport &transport)
+    : transport_(transport),
+      socket_(*transport_.ioService_)
   {
   }
 
-  bool
-  connect(const std::string &unixSocket, ElementListener& elementListener)
+  void
+  connect()
   {
     socket_.open();
-    socket_.connect(protocol::endpoint(unixSocket));
+    socket_.connect(protocol::endpoint(transport_.unixSocket_));
     // socket_.async_connect(protocol::endpoint(unixSocket));
 
     socket_.async_receive(boost::asio::buffer(inputBuffer_, MAX_LENGTH), 0,
                           boost::bind(&Impl::handle_async_receive, this, _1, _2));
-
-    return true;
   }
 
   void 
-  send(const uint8_t *data, size_t dataLength)
-  {
-    socket_.send(boost::asio::buffer(data, dataLength));
-  }
-
-  void
-  processEvents()
-  {
-    io_.poll();
-    // from boost docs:
-    // The poll() function runs handlers that are ready to run, without blocking, until the io_service has been stopped or there are no more ready handlers.
-  }
-
-  void
-  handle_async_receive(const boost::system::error_code& error, std::size_t bytes_recvd)
-  {
-    if (!error && bytes_recvd > 0)
-      {
-        // inputBuffer_ has bytes_recvd received bytes of data
-      }
-
-    socket_.async_receive(boost::asio::buffer(inputBuffer_, MAX_LENGTH), 0,
-                          boost::bind(&Impl::handle_async_receive, this, _1, _2));
-  }
-  
-  void 
   close()
   {
     socket_.close();
   }
+
+  void 
+  send(const Block &wire)
+  {
+    socket_.async_send(boost::asio::buffer(wire.wire(), wire.size()),
+                       boost::bind(&Impl::handle_async_send, this, _1, wire));
+  }
+  
+  void
+  handle_async_receive(const boost::system::error_code& error, std::size_t bytes_recvd)
+  {
+    /// @todo The socket is not datagram, so need to have internal buffer to handle partial data reception
+    
+    if (!error && bytes_recvd > 0)
+      {
+        // inputBuffer_ has bytes_recvd received bytes of data
+        try {
+          Block element(inputBuffer_, bytes_recvd);
+          transport_.receive(element);
+        }
+        catch(Tlv::Error &error)
+          {
+            // pass
+          }
+        catch(Block::Error &error)
+          {
+            // pass
+          }
+      }
+
+    socket_.async_receive(boost::asio::buffer(inputBuffer_, MAX_LENGTH), 0,
+                          boost::bind(&Impl::handle_async_receive, this, _1, _2));
+  }
+
+  void
+  handle_async_send(const boost::system::error_code& error, const Block &wire)
+  {
+    // pass
+  }
   
 private:
-  boost::asio::io_service io_;
-
+  UnixTransport &transport_;
+  
   protocol::socket socket_;
-
   uint8_t inputBuffer_[MAX_LENGTH];
 };
 
 UnixTransport::UnixTransport(const std::string &unixSocket/* = "/tmp/.ndnd.sock"*/) 
   : unixSocket_(unixSocket)
-  , isConnected_(false)
-  , impl_(new UnixTransport::Impl())
 {
 }
 
@@ -93,30 +103,20 @@
 }
 
 void 
-UnixTransport::connect(ElementListener& elementListener)
+UnixTransport::connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback)
 {
-  if (impl_->connect(unixSocket_, elementListener))
-    {
-      isConnected_ = true;
-    }
+  Transport::connect(ioService, receiveCallback);
+  
+  impl_ = std::auto_ptr<UnixTransport::Impl> (new UnixTransport::Impl(*this));
+  impl_->connect();
+  
+  isConnected_ = true;
 }
 
 void 
-UnixTransport::send(const uint8_t *data, size_t dataLength)
+UnixTransport::send(const Block &wire)
 {
-  impl_->send(data, dataLength);
-}
-
-void 
-UnixTransport::processEvents()
-{
-  impl_->processEvents();
-}
-
-bool 
-UnixTransport::getIsConnected()
-{
-  return isConnected_;
+  impl_->send(wire);
 }
 
 void 
