Networking Reference
In-Depth Information
zfile.
This contains the following helper functions to work with files:
zfile_size : This detects the file size.
zfile_mkdir : This creates a directory if it does not exist. However, it goes
only one level deep; therefore, it will create /my_zmq_folder/ but will not
create /my_zmq_files/my_another_folder/ .
zfile_delete : This deletes the file.
zfile_exists : This detects if files already exist or not.
Here is some sample code for zfile . The scenario is that a client receives the
"world" message from the server and writes it to a file.
The following server code is identical to what we have done in the interrupt
signals example:
/*
Request - Reply
Working with files
Helloserver.c
*/
#include "czmq.h"
int main (int argc, char const *argv[]) {
zctx_t* context = zctx_new();
void* socket = zsocket_new(context, ZMQ_REP);
zsocket_bind(socket, "tcp://*:5050");
printf("Starting server...\n");
for(;;) {
char* msg = zstr_recv(socket);
 
Search MirCeyron ::




Custom Search