3839404142434445
System.out.printf("I: normal request (%s)\n", request); Thread.sleep(1000); // Do some heavy work server.send(request); } server.close(); context.term(); } }
2425262728293031
System.out.println("Received reply " + request_nbr + " [" + reply + "]"); } // We never get here but clean up anyhow requester.close(); context.term(); } }
4243444546474849505152
Thread.sleep (rand.nextInt (500) + 1); } catch (InterruptedException e) { } } worker.close(); context.term(); } } /**
ZMQ.proxy (frontend, backend, null); // We never get here but clean up anyhow frontend.close(); backend.close(); context.term(); } }
4748495051525354
publisher.send("END", 0); // clean up publisher.close(); syncservice.close(); context.term(); } }
2526272829303132
// Run the proxy until the user interrupts us ZMQ.proxy (frontend, backend, null); frontend.close(); backend.close(); context.term(); } }
176177178179180181182183184185
} } frontend.close(); backend.close(); context.term(); } }
3031323334353637383940
client.send("HELLO"); String reply = client.recvStr (); System.out.println("Client: " + reply); client.close(); context.term(); } } /** * While this example runs in a single process, that is just to make
6970717273747576777879
worker.sendMore (address); worker.sendMore (""); worker.send("OK"); } worker.close (); context.term (); } } /** * This is the main task. It starts the clients and workers, and then
7273747576777879
// Wait for signal receiver.recv(0); receiver.close (); System.out.println ("Test successful!"); context.term (); } }