code: def wrap(self, wrapper):
          
  
          if self._recv_thread and self._send_thread:
              # Have to suspend the send/recv threads
              self._recv_lock.acquire()
              self._send_lock.acquire()
  
          # Wrap the socket
          self._sock = wrapper(self._sock)
  
          # OK, restart the send/recv threads
          if self._recv_thread and self._send_thread:
              # Release our locks
              self._send_lock.release()
              self._recv_lock.release()
docs: Allows the underlying socket to be wrapped, as by an SSL
          connection.
  
          :param wrapper: A callable taking, as its first argument, a
                          socket.socket object.  The callable must
                          return a valid proxy for the socket.socket
                          object, which will subsequently be used to
                          communicate on the connection.
  
          Note: Be extremely careful with calling this method after the
          TCP connection has been initiated.  The action of this method
          affects both sending and receiving streams simultaneously, and
          no attempt is made to deal with buffered data, other than
          ensuring that both the sending and receiving threads are at
          stopping points.