Created
April 23, 2015 03:49
-
-
Save hintjens/0fd9d0da9739411cac41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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