Networking Reference
In-Depth Information
zsocket_connect(request, "tcp://localhost:5050");
zstr_send(request, "Hello");
zfile_mkdir("test"); // Will work
zfile_mkdir("test2/test3"); // Will not work
zmsg_destroy(&msg);
zsocket_destroy(context, request);
zctx_destroy(&context);
return 0;
}
zhash
This is basically a hash table. It internally uses a Bernstein hash data structure to
hash the strings. You could use zhash for caching; for example, the client sends
a key to the server and receives the e-mail address of a user.
The following is the server code:
/*
Request - Reply
Using zhash.
server.c
*/
#include "czmq.h"
#include <signal.h>
int main (int argc, char const *argv[]) {
zctx_t* context = zctx_new();
 
Search MirCeyron ::




Custom Search