def on_disconnect(self):
        "Called when the socket disconnects"
        self._sock = None
        if self._buffer is not None:
            self._buffer.close()
            self._buffer = None
        self.encoder = None
def on_disconnect ( self ) : self . _sock = None if self . _buffer is not None : self . _buffer . close ( ) self . _buffer = None self . encoder = None
Called when the socket disconnects