cztop 1.0.0 → 1.1.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/coverage.yml +20 -0
- data/.github/workflows/draft_api.yml +27 -0
- data/.github/workflows/{main.yml → stable_api.yml} +6 -6
- data/.rubocop.yml +175 -0
- data/CHANGES.md +8 -1
- data/Gemfile +5 -0
- data/README.md +3 -1
- data/ci/install-libczmq +22 -0
- data/ci/install-libzmq +22 -0
- data/cztop.gemspec +3 -2
- data/lib/cztop/actor.rb +55 -26
- data/lib/cztop/authenticator.rb +18 -9
- data/lib/cztop/beacon.rb +22 -10
- data/lib/cztop/cert_store.rb +8 -2
- data/lib/cztop/certificate.rb +47 -18
- data/lib/cztop/config/comments.rb +14 -3
- data/lib/cztop/config/serialization.rb +25 -5
- data/lib/cztop/config/traversing.rb +44 -13
- data/lib/cztop/config.rb +23 -9
- data/lib/cztop/frame.rb +23 -10
- data/lib/cztop/has_ffi_delegate.rb +11 -1
- data/lib/cztop/message/frames.rb +16 -2
- data/lib/cztop/message.rb +36 -22
- data/lib/cztop/metadata.rb +35 -24
- data/lib/cztop/monitor.rb +14 -5
- data/lib/cztop/poller/aggregated.rb +31 -15
- data/lib/cztop/poller/zmq.rb +25 -22
- data/lib/cztop/poller/zpoller.rb +18 -6
- data/lib/cztop/poller.rb +43 -18
- data/lib/cztop/polymorphic_zsock_methods.rb +6 -1
- data/lib/cztop/proxy.rb +34 -19
- data/lib/cztop/send_receive_methods.rb +5 -1
- data/lib/cztop/socket/types.rb +128 -22
- data/lib/cztop/socket.rb +23 -18
- data/lib/cztop/version.rb +5 -1
- data/lib/cztop/z85/padded.rb +12 -3
- data/lib/cztop/z85/pipe.rb +40 -17
- data/lib/cztop/z85.rb +17 -6
- data/lib/cztop/zap.rb +57 -32
- data/lib/cztop/zsock_options.rb +155 -122
- data/lib/cztop.rb +2 -1
- metadata +28 -10
- data/.ruby-version +0 -1
data/lib/cztop/zsock_options.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module CZTop
|
2
4
|
# This module adds the ability to access options of a {Socket} or an
|
3
5
|
# {Actor}.
|
@@ -9,26 +11,30 @@ module CZTop
|
|
9
11
|
# @see http://api.zeromq.org/czmq3-0:zsock-option
|
10
12
|
#
|
11
13
|
module ZsockOptions
|
14
|
+
|
12
15
|
# Access to the options of this socket.
|
13
16
|
# @return [OptionsAccessor] the memoized options accessor
|
14
17
|
def options
|
15
18
|
@options ||= OptionsAccessor.new(self)
|
16
19
|
end
|
17
20
|
|
21
|
+
|
18
22
|
# Checks whether there's a message that can be read from the socket
|
19
23
|
# without blocking.
|
20
24
|
# @return [Boolean] whether the socket is readable
|
21
25
|
def readable?
|
22
|
-
(options.events & Poller::ZMQ::POLLIN)
|
26
|
+
(options.events & Poller::ZMQ::POLLIN).positive?
|
23
27
|
end
|
24
28
|
|
29
|
+
|
25
30
|
# Checks whether at least one message can be written to the socket without
|
26
31
|
# blocking.
|
27
32
|
# @return [Boolean] whether the socket is writable
|
28
33
|
def writable?
|
29
|
-
(options.events & Poller::ZMQ::POLLOUT)
|
34
|
+
(options.events & Poller::ZMQ::POLLOUT).positive?
|
30
35
|
end
|
31
36
|
|
37
|
+
|
32
38
|
# Useful for registration in an event-loop.
|
33
39
|
# @return [Integer]
|
34
40
|
# @see OptionsAccessor#fd
|
@@ -36,8 +42,10 @@ module CZTop
|
|
36
42
|
options.fd
|
37
43
|
end
|
38
44
|
|
45
|
+
|
39
46
|
# Used to access the options of a {Socket} or {Actor}.
|
40
47
|
class OptionsAccessor
|
48
|
+
|
41
49
|
# @return [Socket, Actor] whose options this {OptionsAccessor} instance
|
42
50
|
# is accessing
|
43
51
|
attr_reader :zocket
|
@@ -47,18 +55,21 @@ module CZTop
|
|
47
55
|
@zocket = zocket
|
48
56
|
end
|
49
57
|
|
58
|
+
|
50
59
|
# Fuzzy option getter. This is to make it easier when porting
|
51
60
|
# applications from CZMQ libraries to CZTop.
|
52
61
|
# @param option_name [Symbol, String] case insensitive option name
|
53
62
|
# @raise [NoMethodError] if option name can't be recognized
|
54
63
|
def [](option_name)
|
55
64
|
# NOTE: beware of predicates, especially #CURVE_server? & friends
|
56
|
-
meth = public_methods.
|
57
|
-
|
65
|
+
meth = public_methods.grep_v(/=$/)
|
66
|
+
.find { |m| m =~ /^#{option_name}\??$/i }
|
58
67
|
raise NoMethodError, option_name if meth.nil?
|
68
|
+
|
59
69
|
__send__(meth)
|
60
70
|
end
|
61
71
|
|
72
|
+
|
62
73
|
# Fuzzy option setter. This is to make it easier when porting
|
63
74
|
# applications from CZMQ libraries to CZTop.
|
64
75
|
# @param option_name [Symbol, String] case insensitive option name
|
@@ -67,6 +78,7 @@ module CZTop
|
|
67
78
|
def []=(option_name, new_value)
|
68
79
|
meth = public_methods.find { |m| m =~ /^#{option_name}=$/i }
|
69
80
|
raise NoMethodError, option_name if meth.nil?
|
81
|
+
|
70
82
|
__send__(meth, new_value)
|
71
83
|
end
|
72
84
|
|
@@ -75,20 +87,37 @@ module CZTop
|
|
75
87
|
# @!group High Water Marks
|
76
88
|
|
77
89
|
# @return [Integer] the send high water mark
|
78
|
-
def sndhwm
|
90
|
+
def sndhwm
|
91
|
+
Zsock.sndhwm(@zocket)
|
92
|
+
end
|
93
|
+
|
94
|
+
|
79
95
|
# @param value [Integer] the new send high water mark.
|
80
|
-
def sndhwm=(value)
|
96
|
+
def sndhwm=(value)
|
97
|
+
Zsock.set_sndhwm(@zocket, value)
|
98
|
+
end
|
99
|
+
|
100
|
+
|
81
101
|
# @return [Integer] the receive high water mark
|
82
|
-
def rcvhwm
|
102
|
+
def rcvhwm
|
103
|
+
Zsock.rcvhwm(@zocket)
|
104
|
+
end
|
105
|
+
|
106
|
+
|
83
107
|
# @param value [Integer] the new receive high water mark
|
84
|
-
def rcvhwm=(value)
|
108
|
+
def rcvhwm=(value)
|
109
|
+
Zsock.set_rcvhwm(@zocket, value)
|
110
|
+
end
|
85
111
|
|
86
112
|
# @!endgroup
|
87
113
|
|
88
114
|
# @!group Security Mechanisms
|
89
115
|
|
90
116
|
# @return [Boolean] whether this zocket is a CURVE server
|
91
|
-
def CURVE_server?
|
117
|
+
def CURVE_server?
|
118
|
+
Zsock.curve_server(@zocket).positive?
|
119
|
+
end
|
120
|
+
|
92
121
|
|
93
122
|
# Make this zocket a CURVE server.
|
94
123
|
# @param bool [Boolean]
|
@@ -97,6 +126,7 @@ module CZTop
|
|
97
126
|
Zsock.set_curve_server(@zocket, bool ? 1 : 0)
|
98
127
|
end
|
99
128
|
|
129
|
+
|
100
130
|
# @return [String] Z85 encoded server key set
|
101
131
|
# @return [nil] if the current mechanism isn't CURVE or CURVE isn't
|
102
132
|
# supported
|
@@ -104,13 +134,16 @@ module CZTop
|
|
104
134
|
CURVE_key(:curve_serverkey)
|
105
135
|
end
|
106
136
|
|
137
|
+
|
107
138
|
# Get one of the CURVE keys.
|
108
139
|
# @param key_name [Symbol] something like +:curve_serverkey+
|
109
140
|
# @return [String, nil] key, if CURVE is supported and active, or nil
|
110
141
|
def CURVE_key(key_name)
|
111
142
|
return nil if mechanism != :CURVE
|
143
|
+
|
112
144
|
ptr = Zsock.__send__(key_name, @zocket)
|
113
145
|
return nil if ptr.null?
|
146
|
+
|
114
147
|
ptr.read_string
|
115
148
|
end
|
116
149
|
private :CURVE_key
|
@@ -127,7 +160,7 @@ module CZTop
|
|
127
160
|
ptr = ::FFI::MemoryPointer.from_string(key)
|
128
161
|
Zsock.set_curve_serverkey_bin(@zocket, ptr)
|
129
162
|
else
|
130
|
-
raise ArgumentError,
|
163
|
+
raise ArgumentError, format('invalid server key: %p', key)
|
131
164
|
end
|
132
165
|
end
|
133
166
|
|
@@ -137,18 +170,19 @@ module CZTop
|
|
137
170
|
1 => :PLAIN, # ZMQ_PLAIN
|
138
171
|
2 => :CURVE, # ZMQ_CURVE
|
139
172
|
3 => :GSSAPI # ZMQ_GSSAPI
|
140
|
-
}
|
173
|
+
}.freeze
|
141
174
|
|
142
175
|
# @return [Symbol] the current security mechanism in use
|
143
176
|
# @note This is automatically set through the use of CURVE certificates,
|
144
177
|
# etc
|
145
178
|
def mechanism
|
146
|
-
#int zsock_mechanism (void *self);
|
179
|
+
# int zsock_mechanism (void *self);
|
147
180
|
code = Zsock.mechanism(@zocket)
|
148
181
|
MECHANISMS[code] or
|
149
|
-
raise
|
182
|
+
raise format('unknown ZMQ security mechanism code: %i', code)
|
150
183
|
end
|
151
184
|
|
185
|
+
|
152
186
|
# @return [String] Z85 encoded secret key set
|
153
187
|
# @return [nil] if the current mechanism isn't CURVE or CURVE isn't
|
154
188
|
# supported
|
@@ -156,6 +190,7 @@ module CZTop
|
|
156
190
|
CURVE_key(:curve_secretkey)
|
157
191
|
end
|
158
192
|
|
193
|
+
|
159
194
|
# @return [String] Z85 encoded public key set
|
160
195
|
# @return [nil] if the current mechanism isn't CURVE or CURVE isn't
|
161
196
|
# supported
|
@@ -163,21 +198,29 @@ module CZTop
|
|
163
198
|
CURVE_key(:curve_publickey)
|
164
199
|
end
|
165
200
|
|
201
|
+
|
166
202
|
# Gets the ZAP domain used for authentication.
|
167
203
|
# @see http://rfc.zeromq.org/spec:27
|
168
204
|
# @return [String]
|
169
205
|
def zap_domain
|
170
206
|
Zsock.zap_domain(@zocket).read_string
|
171
207
|
end
|
208
|
+
|
209
|
+
|
172
210
|
# Sets the ZAP domain used for authentication.
|
173
211
|
# @param domain [String] the new ZAP domain
|
174
212
|
def zap_domain=(domain)
|
175
|
-
raise ArgumentError,
|
213
|
+
raise ArgumentError, 'domain too long' if domain.bytesize > 254
|
214
|
+
|
176
215
|
Zsock.set_zap_domain(@zocket, domain)
|
177
216
|
end
|
178
217
|
|
218
|
+
|
179
219
|
# @return [Boolean] whether this zocket is a PLAIN server
|
180
|
-
def PLAIN_server?
|
220
|
+
def PLAIN_server?
|
221
|
+
Zsock.plain_server(@zocket).positive?
|
222
|
+
end
|
223
|
+
|
181
224
|
|
182
225
|
# Make this zocket a PLAIN server.
|
183
226
|
# @param bool [Boolean]
|
@@ -186,23 +229,32 @@ module CZTop
|
|
186
229
|
Zsock.set_plain_server(@zocket, bool ? 1 : 0)
|
187
230
|
end
|
188
231
|
|
232
|
+
|
189
233
|
# @return [String] username set for PLAIN mechanism
|
190
234
|
# @return [nil] if the current mechanism isn't PLAIN
|
191
235
|
def PLAIN_username
|
192
236
|
return nil if mechanism != :PLAIN
|
237
|
+
|
193
238
|
Zsock.plain_username(@zocket).read_string
|
194
239
|
end
|
240
|
+
|
241
|
+
|
195
242
|
# @param username [String] username for PLAIN mechanism
|
196
243
|
# @note You'll have to use a {CZTop::Authenticator}.
|
197
244
|
def PLAIN_username=(username)
|
198
245
|
Zsock.set_plain_username(@zocket, username)
|
199
246
|
end
|
247
|
+
|
248
|
+
|
200
249
|
# @return [String] password set for PLAIN mechanism
|
201
250
|
# @return [nil] if the current mechanism isn't PLAIN
|
202
251
|
def PLAIN_password
|
203
252
|
return nil if mechanism != :PLAIN
|
253
|
+
|
204
254
|
Zsock.plain_password(@zocket).read_string
|
205
255
|
end
|
256
|
+
|
257
|
+
|
206
258
|
# @param password [String] password for PLAIN mechanism
|
207
259
|
def PLAIN_password=(password)
|
208
260
|
Zsock.set_plain_password(@zocket, password)
|
@@ -214,17 +266,30 @@ module CZTop
|
|
214
266
|
|
215
267
|
# @return [Integer] the timeout when receiving a message
|
216
268
|
# @see Message.receive_from
|
217
|
-
def rcvtimeo
|
269
|
+
def rcvtimeo
|
270
|
+
Zsock.rcvtimeo(@zocket)
|
271
|
+
end
|
272
|
+
|
273
|
+
|
218
274
|
# @param timeout [Integer] new timeout
|
219
275
|
# @see Message.receive_from
|
220
|
-
def rcvtimeo=(timeout)
|
276
|
+
def rcvtimeo=(timeout)
|
277
|
+
Zsock.set_rcvtimeo(@zocket, timeout)
|
278
|
+
end
|
279
|
+
|
221
280
|
|
222
281
|
# @return [Integer] the timeout when sending a message
|
223
282
|
# @see Message#send_to
|
224
|
-
def sndtimeo
|
283
|
+
def sndtimeo
|
284
|
+
Zsock.sndtimeo(@zocket)
|
285
|
+
end
|
286
|
+
|
287
|
+
|
225
288
|
# @param timeout [Integer] new timeout
|
226
289
|
# @see Message#send_to
|
227
|
-
def sndtimeo=(timeout)
|
290
|
+
def sndtimeo=(timeout)
|
291
|
+
Zsock.set_sndtimeo(@zocket, timeout)
|
292
|
+
end
|
228
293
|
|
229
294
|
# @!endgroup
|
230
295
|
|
@@ -235,59 +300,90 @@ module CZTop
|
|
235
300
|
Zsock.set_router_mandatory(@zocket, bool ? 1 : 0)
|
236
301
|
end
|
237
302
|
|
303
|
+
|
238
304
|
# @return [String] current socket identity
|
239
|
-
def identity
|
305
|
+
def identity
|
306
|
+
Zsock.identity(@zocket).read_string
|
307
|
+
end
|
308
|
+
|
309
|
+
|
240
310
|
# @param identity [String] new socket identity
|
241
311
|
# @raise [ArgumentError] if identity is invalid
|
242
312
|
def identity=(identity)
|
243
|
-
raise ArgumentError,
|
244
|
-
raise ArgumentError,
|
245
|
-
raise ArgumentError,
|
313
|
+
raise ArgumentError, 'zero-length identity' if identity.bytesize.zero?
|
314
|
+
raise ArgumentError, 'identity too long' if identity.bytesize > 255
|
315
|
+
raise ArgumentError, 'invalid identity' if identity.start_with? "\0"
|
316
|
+
|
246
317
|
Zsock.set_identity(@zocket, identity)
|
247
318
|
end
|
248
319
|
|
320
|
+
|
249
321
|
# @return [Integer] current value of Type of Service
|
250
|
-
def tos
|
322
|
+
def tos
|
323
|
+
Zsock.tos(@zocket)
|
324
|
+
end
|
325
|
+
|
326
|
+
|
251
327
|
# @param new_value [Integer] new value for Type of Service
|
252
328
|
def tos=(new_value)
|
253
|
-
raise ArgumentError,
|
329
|
+
raise ArgumentError, 'invalid TOS' unless new_value >= 0
|
330
|
+
|
254
331
|
Zsock.set_tos(@zocket, new_value)
|
255
332
|
end
|
256
333
|
|
334
|
+
|
257
335
|
# @return [Integer] current value of Heartbeat IVL
|
258
|
-
def heartbeat_ivl
|
336
|
+
def heartbeat_ivl
|
337
|
+
Zsock.heartbeat_ivl(@zocket)
|
338
|
+
end
|
339
|
+
|
340
|
+
|
259
341
|
# @param new_value [Integer] new value for Heartbeat IVL
|
260
342
|
def heartbeat_ivl=(new_value)
|
261
|
-
raise ArgumentError,
|
343
|
+
raise ArgumentError, 'invalid IVL' unless new_value >= 0
|
344
|
+
|
262
345
|
Zsock.set_heartbeat_ivl(@zocket, new_value)
|
263
346
|
end
|
264
347
|
|
348
|
+
|
265
349
|
# @return [Integer] current value of Heartbeat TTL, in milliseconds
|
266
|
-
def heartbeat_ttl
|
350
|
+
def heartbeat_ttl
|
351
|
+
Zsock.heartbeat_ttl(@zocket)
|
352
|
+
end
|
353
|
+
|
354
|
+
|
267
355
|
# @param new_value [Integer] new value for Heartbeat TTL, in
|
268
356
|
# milliseconds
|
269
357
|
# @note The value will internally be rounded to the nearest decisecond.
|
270
358
|
# So a value of less than 100 will have no effect.
|
271
359
|
def heartbeat_ttl=(new_value)
|
272
|
-
unless new_value.is_a? Integer
|
273
|
-
|
274
|
-
|
275
|
-
unless (0..65536).include? new_value
|
276
|
-
raise ArgumentError, "TTL out of range: #{new_value}"
|
277
|
-
end
|
360
|
+
raise ArgumentError, "invalid TTL: #{new_value}" unless new_value.is_a? Integer
|
361
|
+
raise ArgumentError, "TTL out of range: #{new_value}" unless (0..65_536).include? new_value
|
362
|
+
|
278
363
|
Zsock.set_heartbeat_ttl(@zocket, new_value)
|
279
364
|
end
|
280
365
|
|
366
|
+
|
281
367
|
# @return [Integer] current value of Heartbeat Timeout
|
282
|
-
def heartbeat_timeout
|
368
|
+
def heartbeat_timeout
|
369
|
+
Zsock.heartbeat_timeout(@zocket)
|
370
|
+
end
|
371
|
+
|
372
|
+
|
283
373
|
# @param new_value [Integer] new value for Heartbeat Timeout
|
284
374
|
def heartbeat_timeout=(new_value)
|
285
|
-
raise ArgumentError,
|
375
|
+
raise ArgumentError, 'invalid timeout' unless new_value >= 0
|
376
|
+
|
286
377
|
Zsock.set_heartbeat_timeout(@zocket, new_value)
|
287
378
|
end
|
288
379
|
|
380
|
+
|
289
381
|
# @return [Integer] current value of LINGER
|
290
|
-
def linger
|
382
|
+
def linger
|
383
|
+
Zsock.linger(@zocket)
|
384
|
+
end
|
385
|
+
|
386
|
+
|
291
387
|
# This defines the number of milliseconds to wait while
|
292
388
|
# closing/disconnecting a socket if there are outstanding messages to
|
293
389
|
# send.
|
@@ -300,11 +396,16 @@ module CZTop
|
|
300
396
|
Zsock.set_linger(@zocket, new_value)
|
301
397
|
end
|
302
398
|
|
399
|
+
|
303
400
|
# @return [Boolean] current value of ipv6
|
304
|
-
def ipv6?
|
401
|
+
def ipv6?
|
402
|
+
Zsock.ipv6(@zocket) != 0
|
403
|
+
end
|
404
|
+
|
405
|
+
|
305
406
|
# Set the IPv6 option for the socket. A value of true means IPv6 is
|
306
407
|
# enabled on the socket, while false means the socket will use only
|
307
|
-
# IPv4. When IPv6 is enabled the socket will connect to, or accept
|
408
|
+
# IPv4. When IPv6 is enabled the socket will connect to, or accept
|
308
409
|
# connections from, both IPv4 and IPv6 hosts.
|
309
410
|
# Default is false.
|
310
411
|
# @param new_value [Boolean] new value for ipv6
|
@@ -312,15 +413,26 @@ module CZTop
|
|
312
413
|
Zsock.set_ipv6(@zocket, new_value ? 1 : 0)
|
313
414
|
end
|
314
415
|
|
416
|
+
|
315
417
|
# @return [Integer] socket file descriptor
|
316
|
-
def fd
|
418
|
+
def fd
|
419
|
+
Zsock.fd(@zocket)
|
420
|
+
end
|
421
|
+
|
317
422
|
|
318
423
|
# @return [Integer] socket events (readable/writable)
|
319
424
|
# @see CZTop::Poller::ZMQ::POLLIN and CZTop::Poller::ZMQ::POLLOUT
|
320
|
-
def events
|
425
|
+
def events
|
426
|
+
Zsock.events(@zocket)
|
427
|
+
end
|
428
|
+
|
321
429
|
|
322
430
|
# @return [Integer] current value of RECONNECT_IVL
|
323
|
-
def reconnect_ivl
|
431
|
+
def reconnect_ivl
|
432
|
+
Zsock.reconnect_ivl(@zocket)
|
433
|
+
end
|
434
|
+
|
435
|
+
|
324
436
|
# This defines the number of milliseconds to wait while
|
325
437
|
# closing/disconnecting a socket if there are outstanding messages to
|
326
438
|
# send.
|
@@ -333,86 +445,7 @@ module CZTop
|
|
333
445
|
Zsock.set_reconnect_ivl(@zocket, new_value)
|
334
446
|
end
|
335
447
|
|
336
|
-
# TODO: a reasonable subset of these
|
337
|
-
#// Get socket options
|
338
|
-
#int zsock_gssapi_server (void *self);
|
339
|
-
#int zsock_gssapi_plaintext (void *self);
|
340
|
-
#char * zsock_gssapi_principal (void *self);
|
341
|
-
#char * zsock_gssapi_service_principal (void *self);
|
342
|
-
#int zsock_immediate (void *self);
|
343
|
-
#int zsock_type (void *self);
|
344
|
-
#int zsock_affinity (void *self);
|
345
|
-
#int zsock_rate (void *self);
|
346
|
-
#int zsock_recovery_ivl (void *self);
|
347
|
-
#int zsock_sndbuf (void *self);
|
348
|
-
#int zsock_rcvbuf (void *self);
|
349
|
-
#int zsock_reconnect_ivl_max (void *self);
|
350
|
-
#int zsock_backlog (void *self);
|
351
|
-
#int zsock_maxmsgsize (void *self);
|
352
|
-
#int zsock_multicast_hops (void *self);
|
353
|
-
#int zsock_tcp_keepalive (void *self);
|
354
|
-
#int zsock_tcp_keepalive_idle (void *self);
|
355
|
-
#int zsock_tcp_keepalive_cnt (void *self);
|
356
|
-
#int zsock_tcp_keepalive_intvl (void *self);
|
357
|
-
#int zsock_rcvmore (void *self);
|
358
|
-
#char * zsock_last_endpoint (void *self);
|
359
|
-
#attach_function :zsock_connect_timeout, [:pointer], :int, **opts
|
360
|
-
#attach_function :zsock_handshake_ivl, [:pointer], :int, **opts
|
361
|
-
#attach_function :zsock_invert_matching, [:pointer], :int, **opts
|
362
|
-
#attach_function :zsock_multicast_maxtpdu, [:pointer], :int, **opts
|
363
|
-
#attach_function :zsock_socks_proxy, [:pointer], :pointer, **opts
|
364
|
-
#attach_function :zsock_tcp_maxrt, [:pointer], :int, **opts
|
365
|
-
#attach_function :zsock_thread_safe, [:pointer], :int, **opts
|
366
|
-
#attach_function :zsock_use_fd, [:pointer], :int, **opts
|
367
|
-
#attach_function :zsock_vmci_buffer_max_size, [:pointer], :int, **opts
|
368
|
-
#attach_function :zsock_vmci_buffer_min_size, [:pointer], :int, **opts
|
369
|
-
#attach_function :zsock_vmci_buffer_size, [:pointer], :int, **opts
|
370
|
-
#attach_function :zsock_vmci_connect_timeout, [:pointer], :int, **opts
|
371
|
-
#
|
372
|
-
#// Set socket options
|
373
|
-
#void zsock_set_router_handover (void *self, int router_handover);
|
374
|
-
#void zsock_set_probe_router (void *self, int probe_router);
|
375
|
-
#void zsock_set_req_relaxed (void *self, int req_relaxed);
|
376
|
-
#void zsock_set_req_correlate (void *self, int req_correlate);
|
377
|
-
#void zsock_set_conflate (void *self, int conflate);
|
378
|
-
#void zsock_set_gssapi_server (void *self, int gssapi_server);
|
379
|
-
#void zsock_set_gssapi_plaintext (void *self, int gssapi_plaintext);
|
380
|
-
#void zsock_set_gssapi_principal (void *self, const char * gssapi_principal);
|
381
|
-
#void zsock_set_gssapi_service_principal (void *self, const char * gssapi_service_principal);
|
382
|
-
#void zsock_set_immediate (void *self, int immediate);
|
383
|
-
#void zsock_set_delay_attach_on_connect (void *self, int delay_attach_on_connect);
|
384
|
-
#void zsock_set_affinity (void *self, int affinity);
|
385
|
-
#void zsock_set_rate (void *self, int rate);
|
386
|
-
#void zsock_set_recovery_ivl (void *self, int recovery_ivl);
|
387
|
-
#void zsock_set_sndbuf (void *self, int sndbuf);
|
388
|
-
#void zsock_set_rcvbuf (void *self, int rcvbuf);
|
389
|
-
#void zsock_set_reconnect_ivl_max (void *self, int reconnect_ivl_max);
|
390
|
-
#void zsock_set_backlog (void *self, int backlog);
|
391
|
-
#void zsock_set_maxmsgsize (void *self, int maxmsgsize);
|
392
|
-
#void zsock_set_multicast_hops (void *self, int multicast_hops);
|
393
|
-
#void zsock_set_xpub_verbose (void *self, int xpub_verbose);
|
394
|
-
#void zsock_set_tcp_keepalive (void *self, int tcp_keepalive);
|
395
|
-
#void zsock_set_tcp_keepalive_idle (void *self, int tcp_keepalive_idle);
|
396
|
-
#void zsock_set_tcp_keepalive_cnt (void *self, int tcp_keepalive_cnt);
|
397
|
-
#void zsock_set_tcp_keepalive_intvl (void *self, int tcp_keepalive_intvl);
|
398
|
-
#attach_function :zsock_set_connect_rid, [:pointer, :string], :void, **opts
|
399
|
-
#attach_function :zsock_set_connect_rid_bin, [:pointer, :pointer], :void, **opts
|
400
|
-
#attach_function :zsock_set_connect_timeout, [:pointer, :int], :void, **opts
|
401
|
-
#attach_function :zsock_set_handshake_ivl, [:pointer, :int], :void, **opts
|
402
|
-
#attach_function :zsock_set_invert_matching, [:pointer, :int], :void, **opts
|
403
|
-
#attach_function :zsock_set_multicast_maxtpdu, [:pointer, :int], :void, **opts
|
404
|
-
#attach_function :zsock_set_socks_proxy, [:pointer, :string], :void, **opts
|
405
|
-
#attach_function :zsock_set_stream_notify, [:pointer, :int], :void, **opts
|
406
|
-
#attach_function :zsock_set_tcp_maxrt, [:pointer, :int], :void, **opts
|
407
|
-
#attach_function :zsock_set_use_fd, [:pointer, :int], :void, **opts
|
408
|
-
#attach_function :zsock_set_vmci_buffer_max_size, [:pointer, :int], :void, **opts
|
409
|
-
#attach_function :zsock_set_vmci_buffer_min_size, [:pointer, :int], :void, **opts
|
410
|
-
#attach_function :zsock_set_vmci_buffer_size, [:pointer, :int], :void, **opts
|
411
|
-
#attach_function :zsock_set_vmci_connect_timeout, [:pointer, :int], :void, **opts
|
412
|
-
#attach_function :zsock_set_xpub_manual, [:pointer, :int], :void, **opts
|
413
|
-
#attach_function :zsock_set_xpub_nodrop, [:pointer, :int], :void, **opts
|
414
|
-
#attach_function :zsock_set_xpub_verboser, [:pointer, :int], :void, **opts
|
415
|
-
#attach_function :zsock_set_xpub_welcome_msg, [:pointer, :string], :void, **opts
|
416
448
|
end
|
449
|
+
|
417
450
|
end
|
418
451
|
end
|
data/lib/cztop.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'czmq-ffi-gen'
|
2
4
|
require_relative 'cztop/version'
|
3
5
|
|
@@ -40,7 +42,6 @@ require_relative 'cztop/z85/padded'
|
|
40
42
|
require_relative 'cztop/z85/pipe'
|
41
43
|
require_relative 'cztop/zap'
|
42
44
|
|
43
|
-
|
44
45
|
# make Ctrl-C work in case a low-level call hangs
|
45
46
|
CZMQ::FFI::Signals.disable_default_handling
|
46
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cztop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.1.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Wenger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: czmq-ffi-gen
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.1.0.pre1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.1.0.pre1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.36.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.36.0
|
125
139
|
description:
|
126
140
|
email:
|
127
141
|
- paddor@gmail.com
|
@@ -131,10 +145,12 @@ executables:
|
|
131
145
|
extensions: []
|
132
146
|
extra_rdoc_files: []
|
133
147
|
files:
|
134
|
-
- ".github/workflows/
|
148
|
+
- ".github/workflows/coverage.yml"
|
149
|
+
- ".github/workflows/draft_api.yml"
|
150
|
+
- ".github/workflows/stable_api.yml"
|
135
151
|
- ".gitignore"
|
136
152
|
- ".rspec"
|
137
|
-
- ".
|
153
|
+
- ".rubocop.yml"
|
138
154
|
- ".yardopts"
|
139
155
|
- AUTHORS
|
140
156
|
- CHANGES.md
|
@@ -144,6 +160,8 @@ files:
|
|
144
160
|
- Rakefile
|
145
161
|
- bin/console
|
146
162
|
- bin/setup
|
163
|
+
- ci/install-libczmq
|
164
|
+
- ci/install-libzmq
|
147
165
|
- cztop.gemspec
|
148
166
|
- examples/ruby_actor/actor.rb
|
149
167
|
- examples/simple_req_rep/rep.rb
|
@@ -212,14 +230,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
212
230
|
requirements:
|
213
231
|
- - ">="
|
214
232
|
- !ruby/object:Gem::Version
|
215
|
-
version: 2.
|
233
|
+
version: 2.7.0
|
216
234
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
235
|
requirements:
|
218
|
-
- - "
|
236
|
+
- - ">"
|
219
237
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
238
|
+
version: 1.3.1
|
221
239
|
requirements: []
|
222
|
-
rubygems_version: 3.2.
|
240
|
+
rubygems_version: 3.2.33
|
223
241
|
signing_key:
|
224
242
|
specification_version: 4
|
225
243
|
summary: CZMQ Ruby binding based on the generated low-level FFI bindings of CZMQ
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
3.0
|