146147148149150151152153154155156
ZFrame header = msg.pop(); assert (MDP.W_WORKER.frameEquals(header)); header.destroy(); ZFrame command = msg.pop(); if (MDP.W_REQUEST.frameEquals(command)) { // We should pop and save as many addresses as there are // up to a null part, but for now, just save one replyTo = msg.unwrap(); command.destroy();
303304305306307308309310311312313
if (file != null) file.close(); } catch (IOException e) { } } ZFrame service = request.pop(); String serviceName = service.toString(); // Create MDP client session with short timeout mdcliapi client = new mdcliapi("tcp://localhost:5555", false); client.setTimeout(1000); // 1 sec
142143144145146147148149150151152
} liveness = HEARTBEAT_LIVENESS; // Don't try to handle errors, just assert noisily assert (msg != null && msg.size() >= 3); ZFrame empty = msg.pop(); assert (empty.getData().length == 0); empty.destroy(); ZFrame header = msg.pop(); assert (MDP.W_WORKER.frameEquals(header));
ZFrame empty = msg.pop(); assert (empty.getData().length == 0); empty.destroy(); ZFrame header = msg.pop(); assert (MDP.W_WORKER.frameEquals(header)); header.destroy(); ZFrame command = msg.pop(); if (MDP.W_REQUEST.frameEquals(command)) {
150151152153154155156157158159160
ZFrame header = msg.pop(); assert (MDP.W_WORKER.frameEquals(header)); header.destroy(); ZFrame command = msg.pop(); if (MDP.W_REQUEST.frameEquals(command)) { // We should pop and save as many addresses as there are // up to a null part, but for now, just save one... replyTo = msg.unwrap(); command.destroy();
2930313233343536373839
break; // Interrupted if (items.pollin(0)) { ZMsg msg = ZMsg.recvMsg(frontend); if (msg == null) break; // Interrupted ZFrame address = msg.pop(); address.destroy(); msg.addFirst(new ZFrame("W")); msg.send(backend); } if (items.pollin(1)) {
3839404142434445464748
} if (items.pollin(1)) { ZMsg msg = ZMsg.recvMsg(backend); if (msg == null) break; // Interrupted ZFrame address = msg.pop(); address.destroy(); msg.addFirst(new ZFrame("C")); msg.send(frontend); } }
133134135136137138139140141142143
if (verbose) { log.format("I: received message:\n"); msg.dump(log.out()); } ZFrame sender = msg.pop(); ZFrame empty = msg.pop(); ZFrame header = msg.pop(); if (MDP.C_CLIENT.frameEquals(header)) { processClient(sender, msg);
134135136137138139140141142143144
log.format("I: received message:\n"); msg.dump(log.out()); } ZFrame sender = msg.pop(); ZFrame empty = msg.pop(); ZFrame header = msg.pop(); if (MDP.C_CLIENT.frameEquals(header)) { processClient(sender, msg); } else if (MDP.W_WORKER.frameEquals(header))
135136137138139140141142143144145
msg.dump(log.out()); } ZFrame sender = msg.pop(); ZFrame empty = msg.pop(); ZFrame header = msg.pop(); if (MDP.C_CLIENT.frameEquals(header)) { processClient(sender, msg); } else if (MDP.W_WORKER.frameEquals(header)) processWorker(sender, msg);