Skip to content

Instantly share code, notes, and snippets.

@hintjens
Created April 23, 2015 03:49
Show Gist options
  • Save hintjens/0fd9d0da9739411cac41 to your computer and use it in GitHub Desktop.
Save hintjens/0fd9d0da9739411cac41 to your computer and use it in GitHub Desktop.
#include <malamute.h>
int main (void) {
zactor_t *server = zactor_new (mlm_server, NULL);
zsock_send (server, "sss", "SET", "server/verbose", "1");
zsock_send (server, "ss", "BIND", "inproc://testcase");
mlm_client_verbose = true;
mlm_client_t *client = mlm_client_new ();
int rc = mlm_client_connect (client, "inproc://testcase", 2000, "");
assert (rc == 0);
mlm_client_sendforx (client, "ManagerGive", "gotit", "", NULL);
mlm_client_destroy (&client);
client = mlm_client_new ();
rc = mlm_client_connect (client, "inproc://testcase", 2000, "");
assert (rc == 0);
mlm_client_set_worker (client, "ManagerGive", "got.*");
char *subject, *content;
mlm_client_recvx (client, &subject, &content, NULL);
puts (subject);
assert (streq (subject, "gotit"));
mlm_client_destroy (&client);
zactor_destroy (&server);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment