private void doReceive() {
            ZMsg msg;
            int remainingBuffer = BUFFER_SIZE;
            while (active && remainingBuffer-- > 0 && (msg = ZMsg.recvMsg(socket, ZMQ.DONTWAIT)) != null && msg.size() > 0 && msg.getFirst().hasData()) {
                in.add(msg);
            }
        }