[zeromq-dev] Creating a malamute broker in process

Pieter Hintjens ph at imatix.com
Wed Apr 1 09:10:20 CEST 2015


You have to at the lest:

- start the actor
- tell it what endpoint to bind on OR tell it what config file to load

-Pieter

On Wed, Apr 1, 2015 at 5:56 AM, Kenneth Adam Miller
<kennethadammiller at gmail.com> wrote:
> 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.
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list