diff options
author | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:19 +0100 |
---|---|---|
committer | Martin Lucina <martin@lucina.net> | 2012-01-23 08:53:19 +0100 |
commit | a15854bd92db69fcd0b4444fe1b8fe3610a7acf6 (patch) | |
tree | 1214b945d0f0033ff318de367c70525ea141ef56 /doc/zmq.7 |
Imported Upstream version 2.0.7.dfsgupstream/2.0.7.dfsg
Diffstat (limited to 'doc/zmq.7')
-rw-r--r-- | doc/zmq.7 | 258 |
1 files changed, 258 insertions, 0 deletions
diff --git a/doc/zmq.7 b/doc/zmq.7 new file mode 100644 index 0000000..56cfe1f --- /dev/null +++ b/doc/zmq.7 @@ -0,0 +1,258 @@ +'\" t +.\" Title: zmq +.\" Author: [see the "AUTHORS" section] +.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/> +.\" Date: 06/04/2010 +.\" Manual: 0MQ Manual +.\" Source: 0MQ 2.0.7 +.\" Language: English +.\" +.TH "ZMQ" "7" "06/04/2010" "0MQ 2\&.0\&.7" "0MQ Manual" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +zmq \- 0MQ lightweight messaging kernel +.SH "SYNOPSIS" +.sp +\fB#include <zmq\&.h>\fR +.sp +\fBcc\fR [\fIflags\fR] \fIfiles\fR \fB\-lzmq\fR [\fIlibraries\fR] +.SH "DESCRIPTION" +.sp +The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised \fImessaging middleware\fR products\&. 0MQ sockets provide an abstraction of asynchronous \fImessage queues\fR, multiple \fImessaging patterns\fR, message filtering (\fIsubscriptions\fR), seamless access to multiple \fItransport protocols\fR and more\&. +.sp +This documentation presents an overview of 0MQ concepts, describes how 0MQ abstracts standard sockets and provides a reference manual for the functions provided by the 0MQ library\&. +.SS "Context" +.sp +Before using any 0MQ library functions the caller must initialise a 0MQ \fIcontext\fR using \fIzmq_init()\fR\&. The following functions are provided to handle initialisation and termination of a \fIcontext\fR: +.PP +Initialise 0MQ context +.RS 4 + +\fBzmq_init\fR(3) +.RE +.PP +Terminate 0MQ context +.RS 4 + +\fBzmq_term\fR(3) +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBThread safety\fR +.RS 4 +.sp +A 0MQ \fIcontext\fR is thread safe and may be shared among as many application threads as the application has requested using the \fIapp_threads\fR parameter to \fIzmq_init()\fR, without any additional locking required on the part of the caller\&. Each 0MQ socket belonging to a particular \fIcontext\fR may only be used by \fBthe thread that created it\fR using \fIzmq_socket()\fR\&. +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBMultiple contexts\fR +.RS 4 +.sp +Multiple \fIcontexts\fR may coexist within a single application\&. Thus, an application can use 0MQ directly and at the same time make use of any number of additional libraries or components which themselves make use of 0MQ as long as the above guidelines regarding thread safety are adhered to\&. +.RE +.SS "Messages" +.sp +A 0MQ message is a discrete unit of data passed between applications or components of the same application\&. 0MQ messages have no internal structure and from the point of view of 0MQ itself they are considered to be opaque binary data\&. +.sp +The following functions are provided to work with messages: +.PP +Initialise a message +.RS 4 + +\fBzmq_msg_init\fR(3) +\fBzmq_msg_init_size\fR(3) +\fBzmq_msg_init_data\fR(3) +.RE +.PP +Release a message +.RS 4 + +\fBzmq_msg_close\fR(3) +.RE +.PP +Access message content +.RS 4 + +\fBzmq_msg_data\fR(3) +\fBzmq_msg_size\fR(3) +.RE +.PP +Message manipulation +.RS 4 + +\fBzmq_msg_copy\fR(3) +\fBzmq_msg_move\fR(3) +.RE +.SS "Sockets" +.sp +0MQ sockets present an abstraction of a asynchronous \fImessage queue\fR, with the exact queueing semantics depending on the socket type in use\&. See \fBzmq_socket\fR(3) for the socket types provided\&. +.sp +The following functions are provided to work with sockets: +.PP +Creating a socket +.RS 4 + +\fBzmq_socket\fR(3) +.RE +.PP +Closing a socket +.RS 4 + +\fBzmq_close\fR(3) +.RE +.PP +Manipulating socket options +.RS 4 + +\fBzmq_getsockopt\fR(3) +\fBzmq_setsockopt\fR(3) +.RE +.PP +Establishing a message flow +.RS 4 + +\fBzmq_bind\fR(3) +\fBzmq_connect\fR(3) +.RE +.PP +Sending and receiving messages +.RS 4 + +\fBzmq_send\fR(3) +\fBzmq_recv\fR(3) +.RE +.PP +\fBInput/output multiplexing\fR. 0MQ provides a mechanism for applications to multiplex input/output events over a set containing both 0MQ sockets and standard sockets\&. This mechanism mirrors the standard +\fIpoll()\fR +system call, and is described in detail in +\fBzmq_poll\fR(3)\&. +.SS "Transports" +.sp +A 0MQ socket can use multiple different underlying transport mechanisms\&. Each transport mechanism is suited to a particular purpose and has its own advantages and drawbacks\&. +.sp +The following transport mechanisms are provided: +.PP +Unicast transport using TCP +.RS 4 + +\fBzmq_tcp\fR(7) +.RE +.PP +Reliable multicast transport using PGM +.RS 4 + +\fBzmq_pgm\fR(7) +.RE +.PP +Local inter\-process communication transport +.RS 4 + +\fBzmq_ipc\fR(7) +.RE +.PP +Local in\-process (inter\-thread) communication transport +.RS 4 + +\fBzmq_inproc\fR(7) +.RE +.SS "Devices" +.sp +Apart from the 0MQ library the 0MQ distribution includes \fIdevices\fR which are building blocks intended to serve as intermediate nodes in complex messaging topologies\&. +.sp +The following devices are provided: +.PP +Forwarder device for request\-response messaging +.RS 4 + +\fBzmq_queue\fR(1) +.RE +.PP +Forwarder device for publish\-subscribe messaging +.RS 4 + +\fBzmq_forwarder\fR(1) +.RE +.PP +Streamer device for parallelized pipeline messaging +.RS 4 + +\fBzmq_streamer\fR(1) +.RE +.SH "ERROR HANDLING" +.sp +The 0MQ library functions handle errors using the standard conventions found on POSIX systems\&. Generally, this means that upon failure a 0MQ library function shall return either a NULL value (if returning a pointer) or a negative value (if returning an integer), and the actual error code shall be stored in the \fIerrno\fR variable\&. +.sp +On non\-POSIX systems some users may experience issues with retrieving the correct value of the \fIerrno\fR variable\&. The \fIzmq_errno()\fR function is provided to assist in these cases; for details refer to \fBzmq_errno\fR(3)\&. +.sp +The \fIzmq_strerror()\fR function is provided to translate 0MQ\-specific error codes into error message strings; for details refer to \fBzmq_strerror\fR(3)\&. +.SH "MISCELLANEOUS" +.sp +The following miscellaneous functions are provided: +.PP +Report 0MQ library version +.RS 4 + +\fBzmq_version\fR(3) +.RE +.SH "LANGUAGE BINDINGS" +.sp +The 0MQ library provides interfaces suitable for calling from programs in any language; this documentation documents those interfaces as they would be used by C programmers\&. The intent is that programmers using 0MQ from other languages shall refer to this documentation alongside any documentation provided by the vendor of their language binding\&. +.SS "C++ language binding" +.sp +The 0MQ distribution includes a C++ language binding, which is documented separately in \fBzmq_cpp\fR(7)\&. +.SS "Other language bindings" +.sp +Other language bindings (Python, Ruby, Java and more) are provided by members of the 0MQ community and pointers can be found on the 0MQ website\&. +.SH "AUTHORS" +.sp +The 0MQ documentation was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2> and Martin Lucina <\m[blue]\fBmato@kotelna\&.sk\fR\m[]\&\s-2\u[2]\d\s+2>\&. +.SH "RESOURCES" +.sp +Main web site: \m[blue]\fBhttp://www\&.zeromq\&.org/\fR\m[] +.sp +Report bugs to the 0MQ development mailing list: <\m[blue]\fBzeromq\-dev@lists\&.zeromq\&.org\fR\m[]\&\s-2\u[3]\d\s+2> +.SH "COPYING" +.sp +Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL)\&. For details see the files COPYING and COPYING\&.LESSER included with the 0MQ distribution\&. +.SH "NOTES" +.IP " 1." 4 +sustrik@250bpm.com +.RS 4 +\%mailto:sustrik@250bpm.com +.RE +.IP " 2." 4 +mato@kotelna.sk +.RS 4 +\%mailto:mato@kotelna.sk +.RE +.IP " 3." 4 +zeromq-dev@lists.zeromq.org +.RS 4 +\%mailto:zeromq-dev@lists.zeromq.org +.RE |