'Called when there\'s something to read on the socket'

def _read_socket(self, read_timeout):

    client = self.client
    (header, buffer, offset) = self._read_header(read_timeout)
    if (header.xid == PING_XID):
        self.logger.log(BLATHER, 'Received    Ping')
        self.ping_outstanding.clear()
    elif (header.xid == AUTH_XID):
        self.logger.log(BLATHER, 'Received    AUTH')
        (request, async_object, xid) = client._pending.popleft()
        if header.err:
            async_object.set_exception(AuthFailedError())
            client._session_callback(KeeperState.AUTH_FAILED)
        else:
            async_object.set(True)
    elif (header.xid == WATCH_XID):
        self._read_watch_event(buffer, offset)
    else:
        self.logger.log(BLATHER, 'Reading    for    header    %r', header)
        return self._read_response(header, buffer, offset)
