summaryrefslogtreecommitdiff
path: root/doc/xs_zmq.txt
blob: 310ab64af582276e2740c6d650793168a6976ad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
xs_zmq(7)
=========


NAME
----
xs_zmq - Crossroads I/O ZeroMQ compatibility library


SYNOPSIS
--------
*#include <zmq.h>*

*cc* ['flags'] 'files' *-lzmq* ['libraries']


DESCRIPTION
-----------
This 'libzmq' compatibility library is provided by the Crossroads I/O project
as a transitional drop-in replacement for existing applications and language
bindings written for the ZeroMQ library.

The intent is to ease transition of existing ZeroMQ applications and
language bindings to Crossroads I/O, thus this feature will not be
maintained indefinitely and developers are strongly encouraged to migrate
their applications to native 'libxs' interfaces.

'libzmq' interfaces provided emulate those provided by ZeroMQ release
2.1.11, and binary compatibility is provided for ABI version 1.0.0.

Existing applications can use these interfaces as a drop-in replacement for
the ZeroMQ-provided 'libzmq' by installing the Crossroads version of this
library in its place.  Applications can also be recompiled against this
library with no code or build system changes.

IMPORTANT: The 'libzmq' compatibility library is an optional component of
Crossroads I/O, and is only built and installed if your copy of the
Crossroads library was configured with `--enable-libzmq` at build time.


CONSTANTS
---------

All constants defined by the ZeroMQ 2.1.11 version of *<zmq.h>* are also
defined in the Crossroads version.

INTERFACES
----------

Context
~~~~~~~
[verse]
*void *zmq_init (int 'io_threads');*
*int zmq_term (void '*context');*


Sockets
~~~~~~~
[verse]
*void *zmq_socket (void '*context', int 'type');*
*int zmq_close (void '*socket');*
*int zmq_connect (void '*socket', const char '*endpoint');*
*int zmq_bind (void '*socket', const char '*endpoint');*
*int zmq_setsockopt (void '*socket', int 'option_name', const void '*option_value', size_t 'option_len');*
*int zmq_getsockopt (void '*socket', int 'option_name', void '*option_value', size_t '*option_len');*
*int zmq_poll (zmq_pollitem_t '*items', int 'nitems', long 'timeout');*


Messages
~~~~~~~~
[verse]
*int zmq_msg_init (zmq_msg_t '*msg');*
*int zmq_msg_init_size (zmq_msg_t '*msg', size_t 'size');*
*int zmq_msg_init_data (zmq_msg_t '*msg', void '*data', size_t 'size', zmq_free_fn '*ffn', void '*hint');*
*int zmq_msg_close (zmq_msg_t '*msg');*
*int zmq_msg_copy (zmq_msg_t '*dest', zmq_msg_t '*src');*
*int zmq_msg_move (zmq_msg_t '*dest', zmq_msg_t '*src');*


Sending and receiving
~~~~~~~~~~~~~~~~~~~~~
[verse]
*int zmq_send (void '*socket', zmq_msg_t '*msg', int 'flags');*
*int zmq_recv (void '*socket', zmq_msg_t '*msg', int 'flags');*


Devices
~~~~~~~
[verse]
*int zmq_device (int 'device', const void '*frontend', const void '*backend');*


Error handling
~~~~~~~~~~~~~~
[verse]
*int zmq_errno (void);*
*const char *zmq_strerror (int 'errnum');*


Version detection
~~~~~~~~~~~~~~~~~
[verse]
*void zmq_version (int '*major', int '*minor', int '*patch');*

NOTE: The version numbers returned by this function are the emulated ZeroMQ API
version, i.e. 2.1.11.


COPYING
-------
Free use of Crossroads library 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 Crossroads distribution.

SEE ALSO
--------
linkxs:xs[7]


AUTHORS
-------
The Crossroads documentation was written by Martin Sustrik <sustrik@250bpm.com>
and Martin Lucina <martin@lucina.net>.