diff --git a/ndn-cpp/c/transport/socket-transport.c b/ndn-cpp/c/transport/socket-transport.c
index a6fcbac..2a537db 100644
--- a/ndn-cpp/c/transport/socket-transport.c
+++ b/ndn-cpp/c/transport/socket-transport.c
@@ -13,6 +13,7 @@
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
+#include <poll.h>
 #include "../util/ndn_memory.h"
 
 ndn_Error ndn_SocketTransport_connect(struct ndn_SocketTransport *self, ndn_SocketType socketType, char *host, unsigned short port)
@@ -84,8 +85,36 @@
   return NDN_ERROR_success;  
 }
 
+ndn_Error ndn_SocketTransport_receiveIsReady(struct ndn_SocketTransport *self, int *receiveIsReady)
+{
+  // Default to not ready.
+  *receiveIsReady = 0;
+
+  if (self->socketDescriptor < 0)
+    // The socket is not open.  Just silently return.
+    return NDN_ERROR_success;
+  
+  struct pollfd pollInfo[1];
+  pollInfo[0].fd = self->socketDescriptor;
+  pollInfo[0].events = POLLIN;
+  
+  int pollResult = poll(pollInfo, 1, 200);
+
+  if (pollResult < 0)
+    return NDN_ERROR_SocketTransport_error_in_poll;
+  else if (pollResult == 0)
+    // Timeout, so no data ready.
+    return NDN_ERROR_success;
+  else {
+   if (pollInfo[0].revents & POLLIN)
+     *receiveIsReady = 1;
+  }
+
+  return NDN_ERROR_success;
+}
+
 ndn_Error ndn_SocketTransport_receive
-(struct ndn_SocketTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytesOut)
+  (struct ndn_SocketTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytesOut)
 {
   if (self->socketDescriptor < 0)
     return NDN_ERROR_SocketTransport_socket_is_not_open;
diff --git a/ndn-cpp/c/transport/socket-transport.h b/ndn-cpp/c/transport/socket-transport.h
index 0011e26..6c2da6e 100644
--- a/ndn-cpp/c/transport/socket-transport.h
+++ b/ndn-cpp/c/transport/socket-transport.h
@@ -22,18 +22,59 @@
   int socketDescriptor; /**< -1 if not connected */
 };
   
+/**
+ * Initialize the ndn_SocketTransport struct with default values for no connection yet.
+ * @param self A pointer to the ndn_SocketTransport struct.
+ */
 static inline void ndn_SocketTransport_init(struct ndn_SocketTransport *self)
 {
   self->socketDescriptor = -1;
 }
 
+/**
+ * Connect with TCP or UDP to the host:port.
+ * @param self A pointer to the ndn_SocketTransport struct.
+ * @param socketType SOCKET_TCP or SOCKET_UDP.
+ * @param host The host to connect to.
+ * @param port The port to connect to.
+ * @return 0 for success, else an error code.
+ */
 ndn_Error ndn_SocketTransport_connect(struct ndn_SocketTransport *self, ndn_SocketType socketType, char *host, unsigned short port);
 
+/**
+ * Send data to the socket.
+ * @param self A pointer to the ndn_SocketTransport struct.
+ * @param data A pointer to the buffer of data to send.
+ * @param dataLength The number of bytes in data.
+ * @return 0 for success, else an error code.
+ */
 ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, unsigned char *data, unsigned int dataLength);
 
+/**
+ * Check if there is data ready on the socket to be received with ndn_SocketTransport_receive.
+ * @param self A pointer to the ndn_SocketTransport struct.
+ * @param receiveIsReady This will be set to 1 if data is ready, 0 if not.
+ * @return 0 for success, else an error code.
+ */
+ndn_Error ndn_SocketTransport_receiveIsReady(struct ndn_SocketTransport *self, int *receiveIsReady);
+
+/**
+ * Receive data from the socket.  NOTE: This is a blocking call.  You should first call ndn_SocketTransport_receiveIsReady
+ * to make sure there is data ready to receive.
+ * @param self A pointer to the ndn_SocketTransport struct.
+ * @param buffer A pointer to the buffer to receive the data.
+ * @param bufferLength The maximum length of buffer.
+ * @param nBytes Return the number of bytes received into buffer.
+ * @return 0 for success, else an error code.
+ */
 ndn_Error ndn_SocketTransport_receive
   (struct ndn_SocketTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes);
 
+/**
+ * Close the socket.
+ * @param self A pointer to the ndn_SocketTransport struct.
+ * @return 0 for success, else an error code.
+ */
 ndn_Error ndn_SocketTransport_close(struct ndn_SocketTransport *self);
 
 #ifdef __cplusplus
diff --git a/ndn-cpp/c/transport/tcp-transport.h b/ndn-cpp/c/transport/tcp-transport.h
index f0b5d0c..1860002 100644
--- a/ndn-cpp/c/transport/tcp-transport.h
+++ b/ndn-cpp/c/transport/tcp-transport.h
@@ -18,27 +18,70 @@
   struct ndn_SocketTransport base;
 };
   
+/**
+ * Initialize the ndn_TcpTransport struct with default values for no connection yet.
+ * @param self A pointer to the ndn_TcpTransport struct.
+ */
 static inline void ndn_TcpTransport_init(struct ndn_TcpTransport *self)
 {
   ndn_SocketTransport_init(&self->base);
 }
 
+/**
+ * Connect with TCP to the host:port.
+ * @param self A pointer to the ndn_TcpTransport struct.
+ * @param host The host to connect to.
+ * @param port The port to connect to.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_TcpTransport_connect(struct ndn_TcpTransport *self, char *host, unsigned short port)
 {
   return ndn_SocketTransport_connect(&self->base, SOCKET_TCP, host, port);
 }
 
+/**
+ * Send data to the socket.
+ * @param self A pointer to the ndn_TcpTransport struct.
+ * @param data A pointer to the buffer of data to send.
+ * @param dataLength The number of bytes in data.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_TcpTransport_send(struct ndn_TcpTransport *self, unsigned char *data, unsigned int dataLength)
 {
   return ndn_SocketTransport_send(&self->base, data, dataLength);
 }
 
+/**
+ * Check if there is data ready on the socket to be received with ndn_TcpTransport_receive.
+ * @param self A pointer to the ndn_TcpTransport struct.
+ * @param receiveIsReady This will be set to 1 if data is ready, 0 if not.
+ * @return 0 for success, else an error code.
+ */
+static inline ndn_Error ndn_TcpTransport_receiveIsReady(struct ndn_TcpTransport *self, int *receiveIsReady)
+{
+  return ndn_SocketTransport_receiveIsReady(&self->base, receiveIsReady);
+}
+
+/**
+ * Receive data from the socket.  NOTE: This is a blocking call.  You should first call ndn_SocketTransport_receiveIsReady
+ * to make sure there is data ready to receive.
+ * @param self A pointer to the ndn_TcpTransport struct.
+ * @param buffer A pointer to the buffer to receive the data.
+ * @param bufferLength The maximum length of buffer.
+ * @param nBytes Return the number of bytes received into buffer.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_TcpTransport_receive
   (struct ndn_TcpTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes)
 {
   return ndn_SocketTransport_receive(&self->base, buffer, bufferLength, nBytes);
 }
 
+/**
+ * Close the socket.
+ * @param self A pointer to the ndn_TcpTransport struct.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_TcpTransport_close(struct ndn_TcpTransport *self)
 {
   return ndn_SocketTransport_close(&self->base);
diff --git a/ndn-cpp/c/transport/udp-transport.h b/ndn-cpp/c/transport/udp-transport.h
index 82aee19..c9f0d55 100644
--- a/ndn-cpp/c/transport/udp-transport.h
+++ b/ndn-cpp/c/transport/udp-transport.h
@@ -18,27 +18,70 @@
   struct ndn_SocketTransport base;
 };
   
+/**
+ * Initialize the ndn_UdpTransport struct with default values for no connection yet.
+ * @param self A pointer to the ndn_UdpTransport struct.
+ */
 static inline void ndn_UdpTransport_init(struct ndn_UdpTransport *self)
 {
   ndn_SocketTransport_init(&self->base);
 }
 
+/**
+ * Connect with UDP to the host:port.
+ * @param self A pointer to the ndn_UdpTransport struct.
+ * @param host The host to connect to.
+ * @param port The port to connect to.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_UdpTransport_connect(struct ndn_UdpTransport *self, char *host, unsigned short port)
 {
   return ndn_SocketTransport_connect(&self->base, SOCKET_UDP, host, port);
 }
 
+/**
+ * Send data to the socket.
+ * @param self A pointer to the ndn_UdpTransport struct.
+ * @param data A pointer to the buffer of data to send.
+ * @param dataLength The number of bytes in data.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_UdpTransport_send(struct ndn_UdpTransport *self, unsigned char *data, unsigned int dataLength)
 {
   return ndn_SocketTransport_send(&self->base, data, dataLength);
 }
 
+/**
+ * Check if there is data ready on the socket to be received with ndn_UdpTransport_receive.
+ * @param self A pointer to the ndn_UdpTransport struct.
+ * @param receiveIsReady This will be set to 1 if data is ready, 0 if not.
+ * @return 0 for success, else an error code.
+ */
+static inline ndn_Error ndn_UdpTransport_receiveIsReady(struct ndn_UdpTransport *self, int *receiveIsReady)
+{
+  return ndn_SocketTransport_receiveIsReady(&self->base, receiveIsReady);
+}
+
+/**
+ * Receive data from the socket.  NOTE: This is a blocking call.  You should first call ndn_SocketTransport_receiveIsReady
+ * to make sure there is data ready to receive.
+ * @param self A pointer to the ndn_UdpTransport struct.
+ * @param buffer A pointer to the buffer to receive the data.
+ * @param bufferLength The maximum length of buffer.
+ * @param nBytes Return the number of bytes received into buffer.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_UdpTransport_receive
   (struct ndn_UdpTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes)
 {
   return ndn_SocketTransport_receive(&self->base, buffer, bufferLength, nBytes);
 }
 
+/**
+ * Close the socket.
+ * @param self A pointer to the ndn_UdpTransport struct.
+ * @return 0 for success, else an error code.
+ */
 static inline ndn_Error ndn_UdpTransport_close(struct ndn_UdpTransport *self)
 {
   return ndn_SocketTransport_close(&self->base);
