gpt4 book ai didi

org.zeromq.ZFrame.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 18:24:49 27 4
gpt4 key购买 nike

本文整理了Java中org.zeromq.ZFrame.<init>()方法的一些代码示例,展示了ZFrame.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZFrame.<init>()方法的具体详情如下:
包路径:org.zeromq.ZFrame
类名称:ZFrame
方法名:<init>

ZFrame.<init>介绍

[英]Class Constructor Creates an empty frame. (Useful when reading frames from a 0MQ Socket)
[中]类构造函数创建一个空框架。(从0MQ插槽读取帧时非常有用)

代码示例

代码示例来源:origin: org.zeromq/jeromq

/**
 * Creates a new frame that duplicates an existing frame
 * @return
 *          Duplicate of frame; message contents copied into new byte array
 */
public ZFrame duplicate()
{
  return new ZFrame(this.data);
}

代码示例来源:origin: org.zeromq/jeromq

/**
 * Add a String as a new ZFrame to the end of list
 * @param str
 *              String to add to list
 */
public void addString(String str)
{
  frames.add(new ZFrame(str));
}

代码示例来源:origin: org.zeromq/jeromq

public void addFirst(byte[] data)
{
  addFirst(new ZFrame(data));
}

代码示例来源:origin: org.zeromq/jeromq

public void push(byte[] data)
{
  push(new ZFrame(data));
}

代码示例来源:origin: org.zeromq/jeromq

public void addLast(byte[] data)
{
  addLast(new ZFrame(data));
}

代码示例来源:origin: org.zeromq/jeromq

public void addLast(String stringValue)
{
  addLast(new ZFrame(stringValue));
}

代码示例来源:origin: org.zeromq/jeromq

public boolean add(String stringValue)
{
  return add(new ZFrame(stringValue));
}

代码示例来源:origin: org.zeromq/jeromq

public void addFirst(String stringValue)
{
  addFirst(new ZFrame(stringValue));
}

代码示例来源:origin: org.zeromq/jeromq

public void push(String str)
{
  push(new ZFrame(str));
}

代码示例来源:origin: org.zeromq/jeromq

public boolean add(byte[] data)
{
  return add(new ZFrame(data));
}

代码示例来源:origin: org.zeromq/jeromq

/**
 * Receive a new frame off the socket, Returns newly-allocated frame, or
 * null if there was no input waiting, or if the read was interrupted.
 * @param   socket
 *              Socket to read from
 * @param   flags
 *              Pass flags to 0MQ socket.recv call
 * @return
 *              received frame, else null
 */
public static ZFrame recvFrame(Socket socket, int flags)
{
  ZFrame f = new ZFrame();
  byte[] data = f.recv(socket, flags);
  if (data == null) {
    return null;
  }
  return f;
}

代码示例来源:origin: org.zeromq/jeromq

/**
 * Push frame plus empty frame to front of message, before 1st frame.
 * Message takes ownership of frame, will destroy it when message is sent.
 * @param frame
 */
public void wrap(ZFrame frame)
{
  if (frame != null) {
    push(new ZFrame(""));
    push(frame);
  }
}

代码示例来源:origin: org.zeromq/jeromq

byte[] data = new byte[frameSize];
file.read(data);
rcvMsg.add(new ZFrame(data));

代码示例来源:origin: org.projectreactor/reactor-net

@Override
protected void write(ByteBuffer data, final Deferred<Void, Promise<Void>> onComplete, boolean flush) {
  byte[] bytes = new byte[data.remaining()];
  data.get(bytes);
  boolean isNewMsg = MSG_UPD.compareAndSet(this, null, new ZMsg());
  ZMsg msg = MSG_UPD.get(this);
  if (isNewMsg) {
    switch (socket.getType()) {
      case ZMQ.ROUTER:
        msg.add(new ZFrame(connectionId));
        break;
      default:
    }
  }
  msg.add(new ZFrame(bytes));
  if (flush) {
    doFlush(onComplete);
  }
}

代码示例来源:origin: io.projectreactor/reactor-net

switch (socket.getType()) {
    case ZMQ.ROUTER:
      msg.add(new ZFrame(connectionId));
      break;
    default:
msg.add(new ZFrame(bytes));

代码示例来源:origin: miniway/zper

response.add(new ZFrame(msg.buf().array()));
response.send(worker);

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