diff --git a/pcl_expect/tcp.py b/pcl_expect/tcp.py
index 91cbbf3a5cbf14e337201edbfedb576cc95f64e0..23d824c11e4388f5845e3c8568eaeb52ec3da72e 100644
--- a/pcl_expect/tcp.py
+++ b/pcl_expect/tcp.py
@@ -1,32 +1,55 @@
+"""Connect to a TCP socket.
+
+   This module provides the TcpClient class.  It inherits Expectable
+   and can be used to communicate with a TCP/IP server.
+"""
+
 import socket
 
 import pcl_expect
 
 __all__ = [
-    "Tcp",
+    "TcpBase",
+    "TcpClient",
     ]
 
-class Tcp(pcl_expect.Expectable):
-
-    """Connect to a TCP port."""
+class TcpBase(pcl_expect.Expectable):
 
-    def __init__(self, sockaddr):
-        """Connect a TCP socket to the address given by sockaddr.
-
-           sockaddr is passed to the connect() method of a socket
-           object.  It should normally be a pair of a host name and
-           port number.
+    """Communicate with a remote TCP port."""
 
+    def __init__(self, sock):
+        """Communicate with sock, which should be a connected socket object.
         """
 
-        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-        self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
-        self.sock.connect(sockaddr)
+        self.sock = sock
         pcl_expect.Expectable.__init__(self, self.sock.fileno())
 
     def send(self, s):
+        """Send a string to the remote TCP port."""
         self.sock.send(s)
 
     def close(self):
+        """Close the session."""
         pcl_expect.Expectable.close(self)
         self.sock.close()
+
+class TcpClient(TcpBase):
+
+    """Connect to a remote TCP port."""
+
+    def __init__(self, sockaddr):
+        """Connect a TCP socket to the address given by sockaddr.
+
+           sockaddr is passed to the connect() method of a socket
+           object.  It should normally be a pair of a host name and
+           port number.
+
+        """
+
+        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        sock.connect(sockaddr)
+        TcpBase.__init__(self, sock)
+
+# FIXME (bug 1180): It would be nice to provide a TcpServer class as
+# well, but it wouldn't fit in the current Expectable framework.