Search code examples
javasocketszeromqjeromq

ZMQ (Jeromq) - Missing parameter in socket send documentation


I am currently trying to modify the simple hwclient/hwserver example to send a byte array with predefined size to the server. I have seen that basically the functionality is given in the following form:

public boolean send(byte[] data, int off, int length, int flags)

But there seems to be no documentation about the parameter int off. Can anyone tell be, what this parameter does?

Thanks in advance


Solution

  • It would always be 0 if you want complete byte[] to be consumed if you want a partial consumption mention the offset of that Array index.

    /**
             * Queues a message created from data, so it can be sent.
             *
             * @param data   the data to send.
             * @param off    the index of the first byte to be sent.
             * @param length the number of bytes to be sent.
             * @param flags  a combination (with + or |) of the flags defined below:
             *               </ul>
             * @return true when it has been queued on the socket and ØMQ has assumed responsibility for the message.
             * This does not indicate that the message has been transmitted to the network.
             */
            public boolean send(byte[] data, int off, int length, int flags)