def METHOD_NAME(self):
    self.stdin, self.stdout = sys.stdin, sys.stdout = self._prev_handles
    if self.active:
        if self._handle is not None:
            self._handle.close()
        if self._client is not None:
            self._client.close()
        if self._sock is not None:
            self._sock.close()
        self.active = False
        self.say(SESSION_ENDED.format(self=self))