Package org.zeromq

Examples of org.zeromq.ZContext.destroy()


                kvMsg.destroy();

        alarm = System.currentTimeMillis() + 1000;
      }
    }
        ctx.destroy();
  }

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


    threadPool.submit(zmqw);

    assertTrue("reply was received", latch.await(5, TimeUnit.SECONDS));
    assertTrue("Server was stopped", server.shutdown().await(5, TimeUnit.SECONDS));

    zmq.destroy();
  }

  public static class Pojo {
    private String name;
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

                System.out.printf("I: worker heartbeat\n");
                heartbeatFrame.sendAndKeep(worker);
            }
        }
        // cleanup
        context.destroy();
    }

}
View Full Code Here

        }

        // When we're done, clean up properly
        workers.close();
        context.destroy();
    }
}
View Full Code Here

        assertEquals (reply.id (), FmqMsg.HUGZ);
        reply.destroy ();

        self.destroy ();

        ctx.destroy ();
        //  No clean way to wait for a background thread to exit
        //  Under valgrind this will randomly show as leakage
        //  Reduce this by giving server thread time to exit
        try {Thread.sleep (200);} catch (Exception e) {};
        System.out.printf ("OK\n");
View Full Code Here

        self = FmqMsg.recv (input);
        assert (self != null);
        assertEquals (self.reason (), "Life is short but Now lasts for ever");
        self.destroy ();

        ctx.destroy ();
        System.out.printf ("OK\n");
    }
}
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.