diff --git a/ndn-cpp/c/network/TcpTransport.c b/ndn-cpp/c/network/TcpTransport.c
index 30e6828..dad446c 100644
--- a/ndn-cpp/c/network/TcpTransport.c
+++ b/ndn-cpp/c/network/TcpTransport.c
@@ -26,26 +26,28 @@
 	return &(((struct sockaddr_in6*)sa)->sin6_addr);
 }
 
-ndn_Error ndn_TcpTransport_connect(ndn_TcpTransport *self, char *host, int port)
+ndn_Error ndn_TcpTransport_connect(struct ndn_TcpTransport *self, char *host, unsigned short port)
 {
+  if (self->socketDescriptor >= 0) {
+    close(self->socketDescriptor);
+    self->socketDescriptor = -1;
+  }
   
-}
-
-int testTcpTransport(unsigned char *data, unsigned int dataLength) 
-{
-	struct addrinfo hints, *serverInfo;
-
-  printf("starting\n");
-
+	struct addrinfo hints;
 	memset(&hints, 0, sizeof hints);
 	hints.ai_family = AF_UNSPEC;
 	hints.ai_socktype = SOCK_STREAM;
 
-	if (getaddrinfo("E.hub.ndn.ucla.edu", "9695", &hints, &serverInfo) != 0)
-		return 1;
+  char portString[10];
+  sprintf(portString, "%d", port);
+  
+	struct addrinfo *serverInfo;
+	if (getaddrinfo(host, portString, &hints, &serverInfo) != 0)
+		return NDN_ERROR_TcpTransport_error_in_getaddrinfo;
 
 	// loop through all the results and connect to the first we can
 	struct addrinfo *p;
+  int socketDescriptor;
 	for(p = serverInfo; p != NULL; p = p->ai_next) {
 		if ((socketDescriptor = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
 			continue;
@@ -58,32 +60,47 @@
 		break;
 	}
 
-	if (p == NULL)
-		return 2;
+	if (p == NULL) {
+    freeaddrinfo(serverInfo);
+		return NDN_ERROR_TcpTransport_cannot_connect_to_socket;
+  }
 
-	freeaddrinfo(serverInfo); // all done with this structure
+	freeaddrinfo(serverInfo);
+  self->socketDescriptor = socketDescriptor;
 
+  return 0;
+}
+
+ndn_Error ndn_TcpTransport_send(struct ndn_TcpTransport *self, unsigned char *data, unsigned int dataLength)
+{
+  if (self->socketDescriptor < 0)
+    return NDN_ERROR_TcpTransport_socket_is_not_open;
+  
   int nBytes;
   while (1) {
-    if ((nBytes = send(socketDescriptor, data, dataLength, 0)) < 0)
-      return 1;
+    if ((nBytes = send(self->socketDescriptor, data, dataLength, 0)) < 0)
+      return NDN_ERROR_TcpTransport_error_in_send;
     if (nBytes >= dataLength)
       break;
     
+    // Send more.
     dataLength -= nBytes;
   }
+
+  return 0;  
+}
+
+ndn_Error ndn_TcpTransport_receive
+(struct ndn_TcpTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytesOut)
+{
+  if (self->socketDescriptor < 0)
+    return NDN_ERROR_TcpTransport_socket_is_not_open;
+
+  int nBytes;  
+	if ((nBytes = recv(self->socketDescriptor, buffer, bufferLength, 0)) == -1)
+    return NDN_ERROR_TcpTransport_error_in_recv;
+
+  *nBytesOut = (unsigned int)nBytes;
   
-	unsigned char buffer[1000];
-	if ((nBytes = recv(socketDescriptor, buffer, sizeof(buffer) - 1, 0)) == -1)
-    return 1;
-
-	printf("received %d bytes\n", nBytes);
-  int i;
-  for (i = 0; i < nBytes; ++i)
-    printf("%02X ", (unsigned int)buffer[i]);
-  printf("\n");
-
-	close(socketDescriptor);
-
-	return 0;
+	return 0;  
 }
diff --git a/ndn-cpp/c/network/TcpTransport.h b/ndn-cpp/c/network/TcpTransport.h
index 82ef03b..19ed4e2 100644
--- a/ndn-cpp/c/network/TcpTransport.h
+++ b/ndn-cpp/c/network/TcpTransport.h
@@ -8,6 +8,8 @@
 #ifndef NDN_TCPTRANSPORT_H
 #define	NDN_TCPTRANSPORT_H
 
+#include "../errors.h"
+
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -16,11 +18,18 @@
   int socketDescriptor; /**< -1 if not connected */
 };
   
-static inline void ndn_TcpTransport_init(ndn_TcpTransport *self)
+static inline void ndn_TcpTransport_init(struct ndn_TcpTransport *self)
 {
   self->socketDescriptor = -1;
 }
 
+ndn_Error ndn_TcpTransport_connect(struct ndn_TcpTransport *self, char *host, unsigned short port);
+
+ndn_Error ndn_TcpTransport_send(struct ndn_TcpTransport *self, unsigned char *data, unsigned int dataLength);
+
+ndn_Error ndn_TcpTransport_receive
+  (struct ndn_TcpTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes);
+
 int testTcpTransport(unsigned char *data, unsigned int dataLength);
 
 #ifdef	__cplusplus
diff --git a/tests/test-encode-decode-Interest.cpp b/tests/test-encode-decode-Interest.cpp
index 446a9a4..bba7596 100644
--- a/tests/test-encode-decode-Interest.cpp
+++ b/tests/test-encode-decode-Interest.cpp
@@ -7,6 +7,7 @@
 #include <sstream>
 #include <iostream>
 #include <ndn-cpp/Interest.hpp>
+#include <ndn-cpp/c/network/TcpTransport.h>
 
 using namespace std;
 using namespace ndn;
@@ -37,17 +38,36 @@
 {
   try {
     Interest interest;
+#if 0
     interest.decode(Interest1, sizeof(Interest1));
     cout << "Interest name " << interest.getName().to_uri() << endl;
     cout << "Interest minSuffixComponents " << interest.getMinSuffixComponents() << endl;
     cout << "Interest publisherPublicKeyDigest length " << interest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() << endl;
     cout << "Interest excludeEntryCount " << interest.getExclude().getEntryCount() << endl;
     cout << "InterestLifetimeMilliseconds " << interest.getInterestLifetimeMilliseconds() << endl;
+#endif
     
     vector<unsigned char> encoding;
     interest.encode(encoding);
     cout << "Interest encoding length " << encoding.size() << " vs. sizeof(Interest1) " << sizeof(Interest1) << endl;
+
+    struct ndn_TcpTransport transport;
+    ndn_TcpTransport_init(&transport);
+    ndn_Error error;
+    if (error = ndn_TcpTransport_connect(&transport, (char *)"E.hub.ndn.ucla.edu", 9695))
+      return error;
+    if (error = ndn_TcpTransport_send(&transport, &encoding[0], encoding.size()))
+      return error;
     
+    unsigned char buffer[1000];
+    unsigned int nBytes;
+    if (error = ndn_TcpTransport_receive(&transport, buffer, sizeof(buffer), &nBytes))
+      return error;
+    
+    for (int i = 0; i < nBytes; ++i)
+      printf("%02X ", (unsigned int)buffer[i]);
+    
+#if 0
     Interest reDecodedInterest;
     reDecodedInterest.decode(encoding);
     cout << "Re-decoded Interest name " << reDecodedInterest.getName().to_uri() << endl;
@@ -55,6 +75,7 @@
     cout << "Re-decoded Interest publisherPublicKeyDigest length " << reDecodedInterest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() << endl;
     cout << "Re-decoded Interest excludeEntryCount " << reDecodedInterest.getExclude().getEntryCount() << endl;
     cout << "Re-decoded InterestLifetimeMilliseconds " << reDecodedInterest.getInterestLifetimeMilliseconds() << endl;
+#endif
   } catch (exception &e) {
     cout << "exception: " << e.what() << endl;
   }
