czmq-ffi-gen 0.9.1-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +1 -0
  3. data/CHANGES.md +88 -0
  4. data/Gemfile +2 -0
  5. data/LICENSE +14 -0
  6. data/README.md +112 -0
  7. data/lib/czmq-ffi-gen.rb +7 -0
  8. data/lib/czmq-ffi-gen/czmq/ffi.rb +1210 -0
  9. data/lib/czmq-ffi-gen/czmq/ffi/version.rb +15 -0
  10. data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +186 -0
  11. data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +286 -0
  12. data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +307 -0
  13. data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +222 -0
  14. data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +388 -0
  15. data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +140 -0
  16. data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +442 -0
  17. data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +156 -0
  18. data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +283 -0
  19. data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +194 -0
  20. data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +353 -0
  21. data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +359 -0
  22. data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +416 -0
  23. data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +659 -0
  24. data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +189 -0
  25. data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +365 -0
  26. data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +478 -0
  27. data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +396 -0
  28. data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +515 -0
  29. data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +194 -0
  30. data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +294 -0
  31. data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +3479 -0
  32. data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +203 -0
  33. data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +203 -0
  34. data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +221 -0
  35. data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +227 -0
  36. data/lib/czmq-ffi-gen/errors.rb +12 -0
  37. data/lib/czmq-ffi-gen/gem_version.rb +5 -0
  38. data/lib/czmq-ffi-gen/legacy.rb +16 -0
  39. data/lib/czmq-ffi-gen/libzmq.rb +18 -0
  40. data/lib/czmq-ffi-gen/signals.rb +27 -0
  41. data/lib/czmq-ffi-gen/vendor.rb +5 -0
  42. data/lib/czmq-ffi-gen/versions.rb +19 -0
  43. data/vendor/local/bin/inproc_lat.exe +0 -0
  44. data/vendor/local/bin/inproc_thr.exe +0 -0
  45. data/vendor/local/bin/libczmq.dll +0 -0
  46. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  47. data/vendor/local/bin/libstdc++-6.dll +0 -0
  48. data/vendor/local/bin/libzmq.dll +0 -0
  49. data/vendor/local/bin/local_lat.exe +0 -0
  50. data/vendor/local/bin/local_thr.exe +0 -0
  51. data/vendor/local/bin/remote_lat.exe +0 -0
  52. data/vendor/local/bin/remote_thr.exe +0 -0
  53. data/vendor/local/include/czmq.h +31 -0
  54. data/vendor/local/include/czmq_library.h +199 -0
  55. data/vendor/local/include/czmq_prelude.h +641 -0
  56. data/vendor/local/include/readme.txt +83 -0
  57. data/vendor/local/include/sha1.h +76 -0
  58. data/vendor/local/include/sha1.inc_c +335 -0
  59. data/vendor/local/include/slre.h +92 -0
  60. data/vendor/local/include/slre.inc_c +660 -0
  61. data/vendor/local/include/zactor.h +76 -0
  62. data/vendor/local/include/zarmour.h +114 -0
  63. data/vendor/local/include/zauth.h +100 -0
  64. data/vendor/local/include/zauth_v2.h +88 -0
  65. data/vendor/local/include/zbeacon.h +86 -0
  66. data/vendor/local/include/zbeacon_v2.h +75 -0
  67. data/vendor/local/include/zcert.h +136 -0
  68. data/vendor/local/include/zcertstore.h +100 -0
  69. data/vendor/local/include/zchunk.h +163 -0
  70. data/vendor/local/include/zclock.h +73 -0
  71. data/vendor/local/include/zconfig.h +185 -0
  72. data/vendor/local/include/zctx.h +107 -0
  73. data/vendor/local/include/zdigest.h +65 -0
  74. data/vendor/local/include/zdir.h +149 -0
  75. data/vendor/local/include/zdir_patch.h +82 -0
  76. data/vendor/local/include/zfile.h +177 -0
  77. data/vendor/local/include/zframe.h +176 -0
  78. data/vendor/local/include/zgossip.h +95 -0
  79. data/vendor/local/include/zgossip_engine.inc +927 -0
  80. data/vendor/local/include/zgossip_msg.h +129 -0
  81. data/vendor/local/include/zhash.h +195 -0
  82. data/vendor/local/include/zhash_primes.inc +329 -0
  83. data/vendor/local/include/zhashx.h +298 -0
  84. data/vendor/local/include/ziflist.h +77 -0
  85. data/vendor/local/include/zlist.h +158 -0
  86. data/vendor/local/include/zlistx.h +205 -0
  87. data/vendor/local/include/zloop.h +168 -0
  88. data/vendor/local/include/zmonitor.h +73 -0
  89. data/vendor/local/include/zmonitor_v2.h +56 -0
  90. data/vendor/local/include/zmq.h +617 -0
  91. data/vendor/local/include/zmq_utils.h +48 -0
  92. data/vendor/local/include/zmsg.h +280 -0
  93. data/vendor/local/include/zmutex.h +55 -0
  94. data/vendor/local/include/zpoller.h +92 -0
  95. data/vendor/local/include/zproc.h +168 -0
  96. data/vendor/local/include/zproxy.h +111 -0
  97. data/vendor/local/include/zproxy_v2.h +62 -0
  98. data/vendor/local/include/zrex.h +82 -0
  99. data/vendor/local/include/zsock.h +912 -0
  100. data/vendor/local/include/zsock_option.inc +4126 -0
  101. data/vendor/local/include/zsocket.h +110 -0
  102. data/vendor/local/include/zsockopt.h +256 -0
  103. data/vendor/local/include/zstr.h +110 -0
  104. data/vendor/local/include/zsys.h +386 -0
  105. data/vendor/local/include/zthread.h +50 -0
  106. data/vendor/local/include/ztimerset.h +90 -0
  107. data/vendor/local/include/ztrie.h +106 -0
  108. data/vendor/local/include/zuuid.h +96 -0
  109. data/vendor/local/lib/libczmq.dll.a +0 -0
  110. data/vendor/local/lib/liblibzmq.dll.a +0 -0
  111. data/vendor/local/lib/libzmq-static.a +0 -0
  112. data/vendor/local/lib/pkgconfig/libczmq.pc +23 -0
  113. data/vendor/local/lib/pkgconfig/libzmq.pc +11 -0
  114. data/vendor/local/share/zmq/AUTHORS.txt +147 -0
  115. data/vendor/local/share/zmq/COPYING.LESSER.txt +181 -0
  116. data/vendor/local/share/zmq/COPYING.txt +674 -0
  117. data/vendor/local/share/zmq/NEWS.txt +978 -0
  118. metadata +230 -0
@@ -0,0 +1,205 @@
1
+ /* =========================================================================
2
+ zlistx - extended generic list container
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZLISTX_H_INCLUDED__
15
+ #define __ZLISTX_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zlistx.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ // Destroy an item
27
+ typedef void (zlistx_destructor_fn) (
28
+ void **item);
29
+
30
+ // Duplicate an item
31
+ typedef void * (zlistx_duplicator_fn) (
32
+ const void *item);
33
+
34
+ // Compare two items, for sorting
35
+ typedef int (zlistx_comparator_fn) (
36
+ const void *item1, const void *item2);
37
+
38
+ // Create a new, empty list.
39
+ CZMQ_EXPORT zlistx_t *
40
+ zlistx_new (void);
41
+
42
+ // Destroy a list. If an item destructor was specified, all items in the
43
+ // list are automatically destroyed as well.
44
+ CZMQ_EXPORT void
45
+ zlistx_destroy (zlistx_t **self_p);
46
+
47
+ // Add an item to the head of the list. Calls the item duplicator, if any,
48
+ // on the item. Resets cursor to list head. Returns an item handle on
49
+ // success, NULL if memory was exhausted.
50
+ CZMQ_EXPORT void *
51
+ zlistx_add_start (zlistx_t *self, void *item);
52
+
53
+ // Add an item to the tail of the list. Calls the item duplicator, if any,
54
+ // on the item. Resets cursor to list head. Returns an item handle on
55
+ // success, NULL if memory was exhausted.
56
+ CZMQ_EXPORT void *
57
+ zlistx_add_end (zlistx_t *self, void *item);
58
+
59
+ // Return the number of items in the list
60
+ CZMQ_EXPORT size_t
61
+ zlistx_size (zlistx_t *self);
62
+
63
+ // Return first item in the list, or null, leaves the cursor
64
+ CZMQ_EXPORT void *
65
+ zlistx_head (zlistx_t *self);
66
+
67
+ // Return last item in the list, or null, leaves the cursor
68
+ CZMQ_EXPORT void *
69
+ zlistx_tail (zlistx_t *self);
70
+
71
+ // Return the item at the head of list. If the list is empty, returns NULL.
72
+ // Leaves cursor pointing at the head item, or NULL if the list is empty.
73
+ CZMQ_EXPORT void *
74
+ zlistx_first (zlistx_t *self);
75
+
76
+ // Return the next item. At the end of the list (or in an empty list),
77
+ // returns NULL. Use repeated zlistx_next () calls to work through the list
78
+ // from zlistx_first (). First time, acts as zlistx_first().
79
+ CZMQ_EXPORT void *
80
+ zlistx_next (zlistx_t *self);
81
+
82
+ // Return the previous item. At the start of the list (or in an empty list),
83
+ // returns NULL. Use repeated zlistx_prev () calls to work through the list
84
+ // backwards from zlistx_last (). First time, acts as zlistx_last().
85
+ CZMQ_EXPORT void *
86
+ zlistx_prev (zlistx_t *self);
87
+
88
+ // Return the item at the tail of list. If the list is empty, returns NULL.
89
+ // Leaves cursor pointing at the tail item, or NULL if the list is empty.
90
+ CZMQ_EXPORT void *
91
+ zlistx_last (zlistx_t *self);
92
+
93
+ // Returns the value of the item at the cursor, or NULL if the cursor is
94
+ // not pointing to an item.
95
+ CZMQ_EXPORT void *
96
+ zlistx_item (zlistx_t *self);
97
+
98
+ // Returns the handle of the item at the cursor, or NULL if the cursor is
99
+ // not pointing to an item.
100
+ CZMQ_EXPORT void *
101
+ zlistx_cursor (zlistx_t *self);
102
+
103
+ // Returns the item associated with the given list handle, or NULL if passed
104
+ // in handle is NULL. Asserts that the passed in handle points to a list element.
105
+ CZMQ_EXPORT void *
106
+ zlistx_handle_item (void *handle);
107
+
108
+ // Find an item in the list, searching from the start. Uses the item
109
+ // comparator, if any, else compares item values directly. Returns the
110
+ // item handle found, or NULL. Sets the cursor to the found item, if any.
111
+ CZMQ_EXPORT void *
112
+ zlistx_find (zlistx_t *self, void *item);
113
+
114
+ // Detach an item from the list, using its handle. The item is not modified,
115
+ // and the caller is responsible for destroying it if necessary. If handle is
116
+ // null, detaches the first item on the list. Returns item that was detached,
117
+ // or null if none was. If cursor was at item, moves cursor to previous item,
118
+ // so you can detach items while iterating forwards through a list.
119
+ CZMQ_EXPORT void *
120
+ zlistx_detach (zlistx_t *self, void *handle);
121
+
122
+ // Detach item at the cursor, if any, from the list. The item is not modified,
123
+ // and the caller is responsible for destroying it as necessary. Returns item
124
+ // that was detached, or null if none was. Moves cursor to previous item, so
125
+ // you can detach items while iterating forwards through a list.
126
+ CZMQ_EXPORT void *
127
+ zlistx_detach_cur (zlistx_t *self);
128
+
129
+ // Delete an item, using its handle. Calls the item destructor is any is
130
+ // set. If handle is null, deletes the first item on the list. Returns 0
131
+ // if an item was deleted, -1 if not. If cursor was at item, moves cursor
132
+ // to previous item, so you can delete items while iterating forwards
133
+ // through a list.
134
+ CZMQ_EXPORT int
135
+ zlistx_delete (zlistx_t *self, void *handle);
136
+
137
+ // Move an item to the start of the list, via its handle.
138
+ CZMQ_EXPORT void
139
+ zlistx_move_start (zlistx_t *self, void *handle);
140
+
141
+ // Move an item to the end of the list, via its handle.
142
+ CZMQ_EXPORT void
143
+ zlistx_move_end (zlistx_t *self, void *handle);
144
+
145
+ // Remove all items from the list, and destroy them if the item destructor
146
+ // is set.
147
+ CZMQ_EXPORT void
148
+ zlistx_purge (zlistx_t *self);
149
+
150
+ // Sort the list. If an item comparator was set, calls that to compare
151
+ // items, otherwise compares on item value. The sort is not stable, so may
152
+ // reorder equal items.
153
+ CZMQ_EXPORT void
154
+ zlistx_sort (zlistx_t *self);
155
+
156
+ // Create a new node and insert it into a sorted list. Calls the item
157
+ // duplicator, if any, on the item. If low_value is true, starts searching
158
+ // from the start of the list, otherwise searches from the end. Use the item
159
+ // comparator, if any, to find where to place the new node. Returns a handle
160
+ // to the new node, or NULL if memory was exhausted. Resets the cursor to the
161
+ // list head.
162
+ CZMQ_EXPORT void *
163
+ zlistx_insert (zlistx_t *self, void *item, bool low_value);
164
+
165
+ // Move an item, specified by handle, into position in a sorted list. Uses
166
+ // the item comparator, if any, to determine the new location. If low_value
167
+ // is true, starts searching from the start of the list, otherwise searches
168
+ // from the end.
169
+ CZMQ_EXPORT void
170
+ zlistx_reorder (zlistx_t *self, void *handle, bool low_value);
171
+
172
+ // Make a copy of the list; items are duplicated if you set a duplicator
173
+ // for the list, otherwise not. Copying a null reference returns a null
174
+ // reference.
175
+ CZMQ_EXPORT zlistx_t *
176
+ zlistx_dup (zlistx_t *self);
177
+
178
+ // Set a user-defined deallocator for list items; by default items are not
179
+ // freed when the list is destroyed.
180
+ CZMQ_EXPORT void
181
+ zlistx_set_destructor (zlistx_t *self, zlistx_destructor_fn destructor);
182
+
183
+ // Set a user-defined duplicator for list items; by default items are not
184
+ // copied when the list is duplicated.
185
+ CZMQ_EXPORT void
186
+ zlistx_set_duplicator (zlistx_t *self, zlistx_duplicator_fn duplicator);
187
+
188
+ // Set a user-defined comparator for zlistx_find and zlistx_sort; the method
189
+ // must return -1, 0, or 1 depending on whether item1 is less than, equal to,
190
+ // or greater than, item2.
191
+ CZMQ_EXPORT void
192
+ zlistx_set_comparator (zlistx_t *self, zlistx_comparator_fn comparator);
193
+
194
+ // Self test of this class.
195
+ CZMQ_EXPORT void
196
+ zlistx_test (bool verbose);
197
+
198
+ // @end
199
+
200
+
201
+ #ifdef __cplusplus
202
+ }
203
+ #endif
204
+
205
+ #endif
@@ -0,0 +1,168 @@
1
+ /* =========================================================================
2
+ zloop - event-driven reactor
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZLOOP_H_INCLUDED__
15
+ #define __ZLOOP_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zloop.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ // This class has draft methods, which may change over time. They are not
27
+ // in stable releases, by default. Use --enable-drafts to enable.
28
+ // Callback function for reactor socket activity
29
+ typedef int (zloop_reader_fn) (
30
+ zloop_t *loop, zsock_t *reader, void *arg);
31
+
32
+ // Callback function for reactor events (low-level)
33
+ typedef int (zloop_fn) (
34
+ zloop_t *loop, zmq_pollitem_t *item, void *arg);
35
+
36
+ // Callback for reactor timer events
37
+ typedef int (zloop_timer_fn) (
38
+ zloop_t *loop, int timer_id, void *arg);
39
+
40
+ // Create a new zloop reactor
41
+ CZMQ_EXPORT zloop_t *
42
+ zloop_new (void);
43
+
44
+ // Destroy a reactor
45
+ CZMQ_EXPORT void
46
+ zloop_destroy (zloop_t **self_p);
47
+
48
+ // Register socket reader with the reactor. When the reader has messages,
49
+ // the reactor will call the handler, passing the arg. Returns 0 if OK, -1
50
+ // if there was an error. If you register the same socket more than once,
51
+ // each instance will invoke its corresponding handler.
52
+ CZMQ_EXPORT int
53
+ zloop_reader (zloop_t *self, zsock_t *sock, zloop_reader_fn handler, void *arg);
54
+
55
+ // Cancel a socket reader from the reactor. If multiple readers exist for
56
+ // same socket, cancels ALL of them.
57
+ CZMQ_EXPORT void
58
+ zloop_reader_end (zloop_t *self, zsock_t *sock);
59
+
60
+ // Configure a registered reader to ignore errors. If you do not set this,
61
+ // then readers that have errors are removed from the reactor silently.
62
+ CZMQ_EXPORT void
63
+ zloop_reader_set_tolerant (zloop_t *self, zsock_t *sock);
64
+
65
+ // Register low-level libzmq pollitem with the reactor. When the pollitem
66
+ // is ready, will call the handler, passing the arg. Returns 0 if OK, -1
67
+ // if there was an error. If you register the pollitem more than once, each
68
+ // instance will invoke its corresponding handler. A pollitem with
69
+ // socket=NULL and fd=0 means 'poll on FD zero'.
70
+ CZMQ_EXPORT int
71
+ zloop_poller (zloop_t *self, zmq_pollitem_t *item, zloop_fn handler, void *arg);
72
+
73
+ // Cancel a pollitem from the reactor, specified by socket or FD. If both
74
+ // are specified, uses only socket. If multiple poll items exist for same
75
+ // socket/FD, cancels ALL of them.
76
+ CZMQ_EXPORT void
77
+ zloop_poller_end (zloop_t *self, zmq_pollitem_t *item);
78
+
79
+ // Configure a registered poller to ignore errors. If you do not set this,
80
+ // then poller that have errors are removed from the reactor silently.
81
+ CZMQ_EXPORT void
82
+ zloop_poller_set_tolerant (zloop_t *self, zmq_pollitem_t *item);
83
+
84
+ // Register a timer that expires after some delay and repeats some number of
85
+ // times. At each expiry, will call the handler, passing the arg. To run a
86
+ // timer forever, use 0 times. Returns a timer_id that is used to cancel the
87
+ // timer in the future. Returns -1 if there was an error.
88
+ CZMQ_EXPORT int
89
+ zloop_timer (zloop_t *self, size_t delay, size_t times, zloop_timer_fn handler, void *arg);
90
+
91
+ // Cancel a specific timer identified by a specific timer_id (as returned by
92
+ // zloop_timer).
93
+ CZMQ_EXPORT int
94
+ zloop_timer_end (zloop_t *self, int timer_id);
95
+
96
+ // Register a ticket timer. Ticket timers are very fast in the case where
97
+ // you use a lot of timers (thousands), and frequently remove and add them.
98
+ // The main use case is expiry timers for servers that handle many clients,
99
+ // and which reset the expiry timer for each message received from a client.
100
+ // Whereas normal timers perform poorly as the number of clients grows, the
101
+ // cost of ticket timers is constant, no matter the number of clients. You
102
+ // must set the ticket delay using zloop_set_ticket_delay before creating a
103
+ // ticket. Returns a handle to the timer that you should use in
104
+ // zloop_ticket_reset and zloop_ticket_delete.
105
+ CZMQ_EXPORT void *
106
+ zloop_ticket (zloop_t *self, zloop_timer_fn handler, void *arg);
107
+
108
+ // Reset a ticket timer, which moves it to the end of the ticket list and
109
+ // resets its execution time. This is a very fast operation.
110
+ CZMQ_EXPORT void
111
+ zloop_ticket_reset (zloop_t *self, void *handle);
112
+
113
+ // Delete a ticket timer. We do not actually delete the ticket here, as
114
+ // other code may still refer to the ticket. We mark as deleted, and remove
115
+ // later and safely.
116
+ CZMQ_EXPORT void
117
+ zloop_ticket_delete (zloop_t *self, void *handle);
118
+
119
+ // Set the ticket delay, which applies to all tickets. If you lower the
120
+ // delay and there are already tickets created, the results are undefined.
121
+ CZMQ_EXPORT void
122
+ zloop_set_ticket_delay (zloop_t *self, size_t ticket_delay);
123
+
124
+ // Set hard limit on number of timers allowed. Setting more than a small
125
+ // number of timers (10-100) can have a dramatic impact on the performance
126
+ // of the reactor. For high-volume cases, use ticket timers. If the hard
127
+ // limit is reached, the reactor stops creating new timers and logs an
128
+ // error.
129
+ CZMQ_EXPORT void
130
+ zloop_set_max_timers (zloop_t *self, size_t max_timers);
131
+
132
+ // Set verbose tracing of reactor on/off. The default verbose setting is
133
+ // off (false).
134
+ CZMQ_EXPORT void
135
+ zloop_set_verbose (zloop_t *self, bool verbose);
136
+
137
+ // Start the reactor. Takes control of the thread and returns when the 0MQ
138
+ // context is terminated or the process is interrupted, or any event handler
139
+ // returns -1. Event handlers may register new sockets and timers, and
140
+ // cancel sockets. Returns 0 if interrupted, -1 if canceled by a handler.
141
+ CZMQ_EXPORT int
142
+ zloop_start (zloop_t *self);
143
+
144
+ // Self test of this class.
145
+ CZMQ_EXPORT void
146
+ zloop_test (bool verbose);
147
+
148
+ #ifdef CZMQ_BUILD_DRAFT_API
149
+ // *** Draft method, for development use, may change without warning ***
150
+ // By default the reactor stops if the process receives a SIGINT or SIGTERM
151
+ // signal. This makes it impossible to shut-down message based architectures
152
+ // like zactors. This method lets you switch off break handling. The default
153
+ // nonstop setting is off (false).
154
+ CZMQ_EXPORT void
155
+ zloop_set_nonstop (zloop_t *self, bool nonstop);
156
+
157
+ #endif // CZMQ_BUILD_DRAFT_API
158
+ // @end
159
+
160
+
161
+ // Deprecated method aliases
162
+ #define zloop_set_tolerant(s,i) zloop_poller_set_tolerant(s,i)
163
+
164
+ #ifdef __cplusplus
165
+ }
166
+ #endif
167
+
168
+ #endif
@@ -0,0 +1,73 @@
1
+ /* =========================================================================
2
+ zmonitor - socket event monitor
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZMONITOR_H_INCLUDED__
15
+ #define __ZMONITOR_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @interface
22
+ // Create new zmonitor actor instance to monitor a zsock_t socket:
23
+ //
24
+ // zactor_t *monitor = zactor_new (zmonitor, mysocket);
25
+ //
26
+ // Destroy zmonitor instance.
27
+ //
28
+ // zactor_destroy (&monitor);
29
+ //
30
+ // Enable verbose logging of commands and activity.
31
+ //
32
+ // zstr_send (monitor, "VERBOSE");
33
+ //
34
+ // Listen to monitor event type (zero or types, ending in NULL):
35
+ // zstr_sendx (monitor, "LISTEN", type, ..., NULL);
36
+ //
37
+ // Events:
38
+ // CONNECTED
39
+ // CONNECT_DELAYED
40
+ // CONNECT_RETRIED
41
+ // LISTENING
42
+ // BIND_FAILED
43
+ // ACCEPTED
44
+ // ACCEPT_FAILED
45
+ // CLOSED
46
+ // CLOSE_FAILED
47
+ // DISCONNECTED
48
+ // MONITOR_STOPPED
49
+ // ALL
50
+ //
51
+ // Start monitor; after this, any further LISTEN commands are ignored.
52
+ //
53
+ // zstr_send (monitor, "START");
54
+ // zsock_wait (monitor);
55
+ //
56
+ // Receive next monitor event:
57
+ //
58
+ // zmsg_t *msg = zmsg_recv (monitor);
59
+ //
60
+ // This is the zmonitor constructor as a zactor_fn; the argument can be
61
+ // a zactor_t, zsock_t, or libzmq void * socket:
62
+ CZMQ_EXPORT void
63
+ zmonitor (zsock_t *pipe, void *sock);
64
+
65
+ // Selftest
66
+ CZMQ_EXPORT void
67
+ zmonitor_test (bool verbose);
68
+ // @end
69
+ #ifdef __cplusplus
70
+ }
71
+ #endif
72
+
73
+ #endif
@@ -0,0 +1,56 @@
1
+ /* =========================================================================
2
+ zmonitor_v2 - socket event monitor (deprecated)
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZMONITOR_V2_H_INCLUDED__
15
+ #define __ZMONITOR_V2_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @interface
22
+ // This code needs backporting to work with ZMQ v3.2
23
+ #if (ZMQ_VERSION_MAJOR == 4)
24
+
25
+ // Create a new socket monitor
26
+ CZMQ_EXPORT zmonitor_t *
27
+ zmonitor_new (zctx_t *ctx, void *socket, int events);
28
+
29
+ // Destroy a socket monitor
30
+ CZMQ_EXPORT void
31
+ zmonitor_destroy (zmonitor_t **self_p);
32
+
33
+ // Receive a status message from the monitor; if no message arrives within
34
+ // 500 msec, or the call was interrupted, returns NULL.
35
+ CZMQ_EXPORT zmsg_t *
36
+ zmonitor_recv (zmonitor_t *self);
37
+
38
+ // Get the ZeroMQ socket, for polling
39
+ CZMQ_EXPORT void *
40
+ zmonitor_socket (zmonitor_t *self);
41
+
42
+ // Enable verbose tracing of commands and activity
43
+ CZMQ_EXPORT void
44
+ zmonitor_set_verbose (zmonitor_t *self, bool verbose);
45
+ #endif // ZeroMQ 4.0 or later
46
+
47
+ // Self test of this class
48
+ CZMQ_EXPORT void
49
+ zmonitor_v2_test (bool verbose);
50
+ // @end
51
+
52
+ #ifdef __cplusplus
53
+ }
54
+ #endif
55
+
56
+ #endif