void TSocket::close() {
  if (socket_ != -1) {

#ifdef _WIN32
      shutdown(socket_, SD_BOTH);
      ::closesocket(socket_);
#else
      shutdown(socket_, SHUT_RDWR);
      ::close(socket_);
#endif

  }
  socket_ = -1;
}


客户端连接的套接字在这里进行了关闭


/**
 * Wraps a transport into a buffered one.
 *
 */
class TBufferedTransportFactory : public TTransportFactory {
 public:
  TBufferedTransportFactory() {}

  virtual ~TBufferedTransportFactory() {}

  /**
   * Wraps the transport into a buffered one.
   */
  virtual boost::shared_ptr getTransport(boost::shared_ptr trans) {
    return boost::shared_ptr(new TBufferedTransport(trans));
  }

};