gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 08:38:56 26 4
gpt4 key购买 nike

我目前正在尝试修改简单的 hwclient/hwserver 示例,以将具有预定义大小的字节数组发送到服务器。我已经看到基本上功能是按以下形式给出的:

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

但是似乎没有关于参数int off的文档。谁能告诉我这个参数的作用吗?

提前致谢

最佳答案

如果您希望消耗完整的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)

关于java - ZMQ (Jeromq) - 套接字发送文档中缺少参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61505018/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com