Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void t0() {
- ZMQ.Context context = ZMQ.context(1);
- ZMQ.Socket rep = null;
- ZMQ.Socket req = null;
- try {
- rep = context.socket(ZMQ.REP);
- rep.bind(INPROC_URL);
- TimeUnit.SECONDS.sleep(1);
- for (int i = 1; ; i++) {
- req = context.socket(ZMQ.REQ);
- req.connect(INPROC_URL);
- // want to do some send/recv and then dispose channel
- // ...
- req.close();
- System.out.println("iter# " + i);
- }
- }
- finally {
- rep.close();
- context.term();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment