code: def close(self):
          
          if self._transport is None:
              return
          self._transport.close()
          self._transport._closed.wait()
          self._transport = None
          self._protocol = None
docs: Close the connection.