[zeromq-dev] Creating a malamute broker in process

Kenneth Adam Miller kennethadammiller at gmail.com
Wed Apr 1 05:56:27 CEST 2015


So, I wanted to create a specific broker on a dedicated thread that I could
start up and shut down easily in order to facilitate testing. Here's what I
had for that, consulting mlm_shell, malamute.c and mlm_tutorial:

void startUP(bool verbose=true, zactor_t **server=&global_server) {
  std::cout << "Initializing broker" << std::endl;
  *server = zactor_new (mlm_server, (void *) "Malamute");
  if (verbose) {
    zstr_send (server, "VERBOSE");
    zsock_wait(server);
  }
  //zstr_sendx (server, "LOAD", "malamute.cfg", NULL);

  zactor_t *auth = zactor_new (zauth, NULL);
  assert (auth);
  if (verbose) {
    zstr_sendx (auth, "VERBOSE", NULL);
    zsock_wait (auth);
  }
  std::cout << "Broker initialized" << std::endl;
}

I tried removing everything except the zactor_new(mlm_server call, and I
tried variations on arguments passed to it.

I can start a malamute server on the command line, and my unit tests
interact with that, but I'd like my unit tests to not require human
intervention.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150331/5fda551a/attachment.htm>


More information about the zeromq-dev mailing list