code: def close(self):
          
  
          self._connected = False
          self.buf = b''
  
          if self.sock is not None:
              self.sock.close()
docs: Closes the socket
          Called internally when Exceptions are raised