def disconnect(self):
        '''
        Disconnect from the current host, but do not update the closed state.
        After the transport is disconnected, the closed state will be True if
        this is called after a protocol shutdown, or False if the disconnect
        was in error.

        TODO: do we really need closed vs. connected states? this only adds
        complication and the whole reconnect process has been scrapped anyway.

        '''
        self._connected = False
        if self._transport is not None:
            try:
                self._transport.disconnect()
            except Exception:
                self.logger.error(
                    "Failed to disconnect from %s", self._host, exc_info=True)
                raise
            finally:
                self._transport = None

    ###
    # Transport methods
    ###
dataset/ETHPy150Open agoragames/haigha/haigha/connection.py/Connection.disconnect/original