From 55b64a02e7f3b1ce9e512240a9f9a337ead3b54c Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 22 Nov 2009 08:47:06 +0100 Subject: man pages - initial (dummy) version --- man/man3/zmq_socket.3 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 man/man3/zmq_socket.3 (limited to 'man/man3/zmq_socket.3') diff --git a/man/man3/zmq_socket.3 b/man/man3/zmq_socket.3 new file mode 100644 index 0000000..f404b6b --- /dev/null +++ b/man/man3/zmq_socket.3 @@ -0,0 +1,12 @@ +.TH zmq_socket 3 "" "(c)2007-2009 FastMQ Inc." "0MQ User Manuals" +.SH NAME +zmq_socket \- creates 0MQ socket +.SH SYNOPSIS +.B void *zmq_socket (void *context, int type); +.SH DESCRIPTION +.SH RETURN VALUE +.SH ERRORS +.SH EXAMPLE +.SH SEE ALSO +.SH AUTHOR +Martin Sustrik -- cgit v1.2.3 From e90ada0d044636201c57786307a49a52f9cf7643 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 22 Nov 2009 16:51:21 +0100 Subject: more man pages filled in --- man/man3/zmq_socket.3 | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'man/man3/zmq_socket.3') diff --git a/man/man3/zmq_socket.3 b/man/man3/zmq_socket.3 index f404b6b..8b819b5 100644 --- a/man/man3/zmq_socket.3 +++ b/man/man3/zmq_socket.3 @@ -4,9 +4,65 @@ zmq_socket \- creates 0MQ socket .SH SYNOPSIS .B void *zmq_socket (void *context, int type); .SH DESCRIPTION +Open a socket within the specified +.IR context . +To create a context, use +.IR zmq_init +function. +.IR type +argument can be one of the values defined below. Note that each socket is owned +by exactly one thread (the one that it was created from) and should not be used +from any other thread. + +.IP "\fBZMQ_P2P\fP" +Socket to communicate with a single peer. Allows for only a single connect or a +single bind. There's no message routing or message filtering involved. + +.IP "\fBZMQ_PUB\fP" +Socket to distribute data. Recv fuction is not implemented for this socket +type. Messages are distributed in fanout fashion to all the peers. + +.IP "\fBZMQ_SUB\fP" +Socket to subscribe for data. Send function is not implemented for this +socket type. Initially, socket is subscribed for no messages. Use ZMQ_SUBSCRIBE +option to specify which messages to subscribe for. + +.IP "\fBZMQ_REQ\fP" +Socket to send requests and receive replies. Requests are load-balanced among +all the peers. This socket type allows only an alternated sequence of +send's and recv's. + +.IP "\fBZMQ_REP\fP" +Socket to receive requests and send replies. This socket type allows +only an alternated sequence of recv's and send's. Each send is routed to +the peer that issued the last received request. + .SH RETURN VALUE +Function returns socket handle is successful. Otherwise it returns NULL and +sets errno to one of the values below. .SH ERRORS +.IP "\fBEINVAL\fP" +invalid socket type. +.IP "\fBEMTHREAD\fP" +the number of application threads allowed to own 0MQ sockets was exceeded. See +.IR app_threads +parameter to +.IR zmq_init +function. .SH EXAMPLE +.nf +void *s = zmq_socket (context, ZMQ_PUB); +assert (s); +int rc = zmq_bind (s, "tcp://192.168.0.1:5555"); +assert (rc == 0); +.fi .SH SEE ALSO +.BR zmq_init (3) +.BR zmq_setsockopt (3) +.BR zmq_bind (3) +.BR zmq_connect (3) +.BR zmq_send (3) +.BR zmq_flush (3) +.BR zmq_recv (3) .SH AUTHOR Martin Sustrik -- cgit v1.2.3 From c98fd6bc3f2a49d7cb0b820a07354168c98f60b7 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Tue, 24 Nov 2009 11:23:10 +0100 Subject: ZMQII-25: Implement streamed request/reply --- man/man3/zmq_socket.3 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'man/man3/zmq_socket.3') diff --git a/man/man3/zmq_socket.3 b/man/man3/zmq_socket.3 index 8b819b5..a73bba5 100644 --- a/man/man3/zmq_socket.3 +++ b/man/man3/zmq_socket.3 @@ -37,6 +37,15 @@ Socket to receive requests and send replies. This socket type allows only an alternated sequence of recv's and send's. Each send is routed to the peer that issued the last received request. +.IP "\fBZMQ_UPSTREAM\fP" +Socket to receive messages from up the stream. Messages are fair-queued +from among all the connected peers. Send function is not implemented for +this socket type. + +.IP "\fBZMQ_DOWNSTREAM\fP" +Socket to send messages down stream. Messages are load-balanced among all the +connected peers. Send function is not implemented for this socket type. + .SH RETURN VALUE Function returns socket handle is successful. Otherwise it returns NULL and sets errno to one of the values below. -- cgit v1.2.3