Package org.zeromq

Examples of org.zeromq.ZContext.destroy()


                msg.getLast().print("Worker: ");
                msg.getLast().reset("OK");
                msg.send(worker);

            }
            ctx.destroy();
        }
    }

    //  The main task begins by setting-up its frontend and backend sockets
    //  and then starting its client and worker tasks:
View Full Code Here


                break;
            String data = subscriber.recvStr();
            assert(topic.equals(subscription));
            System.out.println(data);
        }
        context.destroy();
    }
}
View Full Code Here

                    address.destroy();
                    msg.addFirst(new ZFrame("C"));
                    msg.send(frontend);
                }
            }
            ctx.destroy();
        }

    }

    static class Worker implements Runnable {
View Full Code Here

            while (!Thread.currentThread().isInterrupted()) {
                ZMsg msg = ZMsg.recvMsg(worker);
                msg.send(worker);
            }

            ctx.destroy();

        }

    }
View Full Code Here

            }

            System.out.printf(" %d calls/second\n",
                    (1000 * SAMPLE_SIZE) / (System.currentTimeMillis() - start));

            ctx.destroy();
        }

    }

    public static void main(String[] args) {
View Full Code Here

                    //  Send request again, on new socket
                    client.send(request);
                }
            }
        }
        ctx.destroy();

    }
}
View Full Code Here

        while (workers.size() > 0) {
            ZFrame frame = workers.remove(0);
            frame.destroy();
        }

        ctx.destroy();
    }
}
View Full Code Here

                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                }
            }
            ctx.destroy();
        }
    }

    //  The worker task plugs into the LRU routing dialog using a REQ
    //  socket:
View Full Code Here

        if (reply != null) {
            System.out.printf ("Service is running OK\n");
            reply.destroy();
        }
        request.destroy();;
        ctx.destroy();
    }

}
View Full Code Here

            clonecli1.kvMap.put(kvMsg.getKey(), kvMsg);
            System.out.println("receiving " + kvMsg);
            sequence.incrementAndGet();
    }
        ctx.destroy();
  }

  public static void main(String[] args) {
    new clonecli1().run();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.