public ArrayList<Integer> getWaitingQueueIds() throws QueueGetWaitingException {
        try {
            _out.writeInt(8); //Size
            _out.writeInt(Response.MSG_GET_WAITING_QUEUES);
            _out.writeInt(_clientId);
            _out.flush();

            int messageType = _in.readInt();
            if(messageType != Response.STATUS_OK) {
                int errorCode = _in.readInt();
                if(errorCode == Response.ERR_QUEUE_GET_WAITING_EXCEPTION) {
                    throw new QueueGetWaitingException(new Exception());
                }
            }

            int size = _in.readInt();
            ArrayList<Integer> waitingQueues = new ArrayList<Integer>(size);
            for (int i = 0; i < size; i++) {
                waitingQueues.add(i, _in.readInt());
            }

            return waitingQueues;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }