The PooledSocket class encapsulates a socket connection to a specified memcached server. It contains a buffered stream for communication, and methods for sending and retrieving data from the memcached server, as well as general memcached error checking.