简体   繁体   English

ZMQ (Jeromq) - 套接字发送文档中缺少参数

[英]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.我目前正在尝试修改简单的 hwclient/hwserver 示例,以将具有预定义大小的字节数组发送到服务器。 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 .但似乎没有关于参数int off的文档。 Can anyone tell be, what this parameter does?谁能告诉我,这个参数有什么作用?

Thanks in advance提前致谢

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.如果您希望部分消费提及该数组索引的偏移量,则如果您希望消费完整的byte[] ,则它始终为 0。

/**
         * 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM