本文整理了Java中org.zeromq.ZFrame.getData()
方法的一些代码示例,展示了ZFrame.getData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZFrame.getData()
方法的具体详情如下:
包路径:org.zeromq.ZFrame
类名称:ZFrame
方法名:getData
暂无
代码示例来源:origin: twosigma/beakerx
private String verifyDelim(ZFrame zframe) {
String delim = new String(zframe.getData(), StandardCharsets.UTF_8);
if (!DELIM.equals(delim)) {
throw new RuntimeException("Delimiter <IDS|MSG> not found");
}
return delim;
}
代码示例来源:origin: twosigma/beakerx
private Message readMessage(ZMQ.Socket socket) {
ZMsg zmsg = null;
Message message = null;
try {
zmsg = ZMsg.recvMsg(socket);
ZFrame[] parts = new ZFrame[zmsg.size()];
zmsg.toArray(parts);
byte[] uuid = parts[MessageParts.UUID].getData();
byte[] header = parts[MessageParts.HEADER].getData();
byte[] parent = parts[MessageParts.PARENT].getData();
byte[] metadata = parts[MessageParts.METADATA].getData();
byte[] content = parts[MessageParts.CONTENT].getData();
byte[] expectedSig = parts[MessageParts.HMAC].getData();
verifyDelim(parts[MessageParts.DELIM]);
verifySignatures(expectedSig, header, parent, metadata, content);
message = new Message(parse(header, Header.class));
if (uuid != null) {
message.getIdentities().add(uuid);
}
message.setParentHeader(parse(parent, Header.class));
message.setMetadata(parse(metadata, LinkedHashMap.class));
message.setContent(parse(content, LinkedHashMap.class));
} finally {
if (zmsg != null) {
zmsg.destroy();
}
}
return message;
}
代码示例来源:origin: org.zeromq/jeromq
public void print(String prefix)
{
ZData.print(System.out, prefix, getData(), size());
}
}
代码示例来源:origin: fiber-space/jupyter-kernel-jsr223
throw new RuntimeException("[jupyter-kernel.jar] Message incomplete. Didn't receive required message parts");
uuid = zframes[MessageParts.UUID].getData();
String delim = new String(zframes[MessageParts.DELIM].getData(),
StandardCharsets.UTF_8);
if (!delim.equals(delimiter)) {
throw new RuntimeException("[jupyter-kernel.jar] Incorrectly formatted message. Delimiter <IDS|MSG> not found");
byte[] header = zframes[MessageParts.HEADER].getData();
byte[] parent = zframes[MessageParts.PARENT].getData();
byte[] meta = zframes[MessageParts.METADATA].getData();
byte[] content = zframes[MessageParts.CONTENT].getData();
byte[] hmac = zframes[MessageParts.HMAC].getData();
代码示例来源:origin: org.zeromq/jeromq
file.write(f.getData());
代码示例来源:origin: org.zeromq/jeromq
/**
* Send a frame
*
* @param frame
* @param flags
* @return return true if successful
*/
public boolean sendFrame(ZFrame frame, int flags)
{
final byte[] data = frame.getData();
final Msg msg = new Msg(data);
if (socketBase.send(msg, flags)) {
return true;
}
mayRaise();
return false;
}
代码示例来源:origin: org.zeromq/jeromq
@Override
public ZMsg recv(boolean wait)
{
if (locked) {
return null;
}
try {
ZMsg msg = ZMsg.recvMsg(pipe, wait);
if (msg == null) {
return null;
}
if (msg.size() == 1) {
final ZFrame frame = msg.peek();
byte[] key = frame.getData();
if (lock != null && Arrays.equals(lock, key)) {
locked = true;
// this is the last message anyway, and not a one for a public display
msg = null;
pipe.close();
}
}
return msg;
}
catch (ZMQException e) {
locked = true;
return null;
}
}
代码示例来源:origin: org.zeromq/jeromq
byte[] clientPublicKey = frame.getData();
username = null;
password = null;
代码示例来源:origin: org.projectreactor/reactor-net
@Override
public int handle(ZLoop loop, ZMQ.PollItem item, Object arg) {
ZMsg msg = ZMsg.recvMsg(socket);
if (null == msg || msg.size() == 0) {
return 0;
}
if (closed) {
return -1;
}
String connId;
switch (ZeroMQWorker.this.socketType) {
case ZMQ.ROUTER:
connId = msg.popString();
break;
default:
connId = ZeroMQWorker.this.id.toString();
}
ZeroMQNetChannel<IN, OUT> netChannel = select(connId)
.setConnectionId(connId)
.setSocket(socket);
ZFrame content;
while (null != (content = msg.pop())) {
netChannel.read(Buffer.wrap(content.getData()));
}
msg.destroy();
return 0;
}
};
代码示例来源:origin: org.opendaylight.netide/shim
if (poller.pollin(0)) {
ZMsg message = ZMsg.recvMsg(socket);
byte[] data = message.getLast().getData();
if (coreListener != null) {
Message msg = NetIPConverter.parseConcreteMessage(data);
代码示例来源:origin: kawasima/enkan
ReplResponse completerRes = fressian.read(completerMsg.pop().getData(), ReplResponse.class);
String completerPort = completerRes.getOut();
if (completerPort != null && completerPort.matches("\\d+")) {
try {
ZMsg msg = ZMsg.recvMsg(this.socket);
ReplResponse res = fressian.read(msg.pop().getData(), ReplResponse.class);
if (res.getOut() != null) {
console.println(res.getOut());
内容来源于网络,如有侵权,请联系作者删除!