This repository has been archived by the owner on Feb 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathzmqgen_3_2.go
436 lines (381 loc) · 11.5 KB
/
zmqgen_3_2.go
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
// +build zmq_3_x
//
package gozmq
import (
"time"
)
// This file was generated automatically. Changes made here will be lost.
// Socket Option Getters
// ZMQ_TYPE: Retrieve socket type.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc3
//
func (s *Socket) Type() (SocketType, error) {
value, err := s.GetSockOptUInt64(TYPE)
return SocketType(value), err
}
// ZMQ_RCVMORE: More message data parts to follow.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc4
//
func (s *Socket) RcvMore() (bool, error) {
value, err := s.GetSockOptInt(RCVMORE)
return value != 0, err
}
// ZMQ_SNDHWM: Retrieves high water mark for outbound messages.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc5
//
func (s *Socket) SndHWM() (int, error) {
return s.GetSockOptInt(SNDHWM)
}
// ZMQ_RCVHWM: Retrieve high water mark for inbound messages.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc6
//
func (s *Socket) RcvHWM() (int, error) {
return s.GetSockOptInt(RCVHWM)
}
// ZMQ_AFFINITY: Retrieve I/O thread affinity.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc7
//
func (s *Socket) Affinity() (uint64, error) {
return s.GetSockOptUInt64(AFFINITY)
}
// ZMQ_IDENTITY: Set socket identity.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc8
//
func (s *Socket) Identity() (string, error) {
return s.GetSockOptString(IDENTITY)
}
// ZMQ_RATE: Retrieve multicast data rate.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc9
//
func (s *Socket) Rate() (int64, error) {
return s.GetSockOptInt64(RATE)
}
// ZMQ_RECOVERY_IVL: Get multicast recovery interval.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc10
//
func (s *Socket) RecoveryIvl() (time.Duration, error) {
ms, err := s.GetSockOptInt64(RECOVERY_IVL)
return time.Duration(ms) * time.Millisecond, err
}
// ZMQ_SNDBUF: Retrieve kernel transmit buffer size.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc11
//
func (s *Socket) SndBuf() (uint64, error) {
return s.GetSockOptUInt64(SNDBUF)
}
// ZMQ_RCVBUF: Retrieve kernel receive buffer size.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc12
//
func (s *Socket) RcvBuf() (uint64, error) {
return s.GetSockOptUInt64(RCVBUF)
}
// ZMQ_LINGER: Retrieve linger period for socket shutdown.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc13
//
func (s *Socket) Linger() (time.Duration, error) {
ms, err := s.GetSockOptInt(LINGER)
return time.Duration(ms) * time.Millisecond, err
}
// ZMQ_RECONNECT_IVL: Retrieve reconnection interval.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc14
//
func (s *Socket) ReconnectIvl() (time.Duration, error) {
ms, err := s.GetSockOptInt(RECONNECT_IVL)
return time.Duration(ms) * time.Millisecond, err
}
// ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc15
//
func (s *Socket) ReconnectIvlMax() (time.Duration, error) {
ms, err := s.GetSockOptInt(RECONNECT_IVL_MAX)
return time.Duration(ms) * time.Millisecond, err
}
// ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc16
//
func (s *Socket) Backlog() (int, error) {
return s.GetSockOptInt(BACKLOG)
}
// ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc17
//
func (s *Socket) MaxMsgSize() (int64, error) {
return s.GetSockOptInt64(MAXMSGSIZE)
}
// ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc19
//
func (s *Socket) RcvTimeout() (time.Duration, error) {
ms, err := s.GetSockOptInt(RCVTIMEO)
return time.Duration(ms) * time.Millisecond, err
}
// ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc20
//
func (s *Socket) SndTimeout() (time.Duration, error) {
ms, err := s.GetSockOptInt(SNDTIMEO)
return time.Duration(ms) * time.Millisecond, err
}
// ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc21
//
func (s *Socket) IPv4Only() (bool, error) {
value, err := s.GetSockOptInt(IPV4ONLY)
return value != 0, err
}
// ZMQ_DELAY_ATTACH_ON_CONNECT: Retrieve attach-on-connect value.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc22
//
func (s *Socket) DelayAttachOnConnect() (bool, error) {
value, err := s.GetSockOptInt(DELAY_ATTACH_ON_CONNECT)
return value != 0, err
}
// ZMQ_EVENTS: Retrieve socket event state.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc24
//
func (s *Socket) Events() (uint64, error) {
return s.GetSockOptUInt64(EVENTS)
}
// ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc26
//
func (s *Socket) TCPKeepalive() (int, error) {
return s.GetSockOptInt(TCP_KEEPALIVE)
}
// ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS).
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc27
//
func (s *Socket) TCPKeepaliveIdle() (int, error) {
return s.GetSockOptInt(TCP_KEEPALIVE_IDLE)
}
// ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc28
//
func (s *Socket) TCPKeepaliveCnt() (int, error) {
return s.GetSockOptInt(TCP_KEEPALIVE_CNT)
}
// ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc29
//
func (s *Socket) TCPKeepaliveIntvl() (int, error) {
return s.GetSockOptInt(TCP_KEEPALIVE_INTVL)
}
// Socket Option Setters
// ZMQ_SNDHWM: Set high water mark for outbound messages.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc3
//
func (s *Socket) SetSndHWM(value int) error {
return s.SetSockOptInt(SNDHWM, value)
}
// ZMQ_RCVHWM: Set high water mark for inbound messages.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc4
//
func (s *Socket) SetRcvHWM(value int) error {
return s.SetSockOptInt(RCVHWM, value)
}
// ZMQ_AFFINITY: Set I/O thread affinity.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc5
//
func (s *Socket) SetAffinity(value uint64) error {
return s.SetSockOptUInt64(AFFINITY, value)
}
// ZMQ_SUBSCRIBE: Establish message filter.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc6
//
func (s *Socket) SetSubscribe(value string) error {
return s.SetSockOptString(SUBSCRIBE, value)
}
// ZMQ_UNSUBSCRIBE: Remove message filter.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc7
//
func (s *Socket) SetUnsubscribe(value string) error {
return s.SetSockOptString(UNSUBSCRIBE, value)
}
// ZMQ_IDENTITY: Set socket identity.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc8
//
func (s *Socket) SetIdentity(value string) error {
return s.SetSockOptString(IDENTITY, value)
}
// ZMQ_RATE: Set multicast data rate.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc9
//
func (s *Socket) SetRate(value int64) error {
return s.SetSockOptInt64(RATE, value)
}
// ZMQ_RECOVERY_IVL: Set multicast recovery interval.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc10
//
func (s *Socket) SetRecoveryIvl(value time.Duration) error {
return s.SetSockOptInt64(RECOVERY_IVL, int64(value/time.Millisecond))
}
// ZMQ_SNDBUF: Set kernel transmit buffer size.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc11
//
func (s *Socket) SetSndBuf(value uint64) error {
return s.SetSockOptUInt64(SNDBUF, value)
}
// ZMQ_RCVBUF: Set kernel receive buffer size.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc12
//
func (s *Socket) SetRcvBuf(value uint64) error {
return s.SetSockOptUInt64(RCVBUF, value)
}
// ZMQ_LINGER: Set linger period for socket shutdown.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc13
//
func (s *Socket) SetLinger(value time.Duration) error {
return s.SetSockOptInt(LINGER, int(value/time.Millisecond))
}
// ZMQ_RECONNECT_IVL: Set reconnection interval.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc14
//
func (s *Socket) SetReconnectIvl(value time.Duration) error {
return s.SetSockOptInt(RECONNECT_IVL, int(value/time.Millisecond))
}
// ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc15
//
func (s *Socket) SetReconnectIvlMax(value time.Duration) error {
return s.SetSockOptInt(RECONNECT_IVL_MAX, int(value/time.Millisecond))
}
// ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc16
//
func (s *Socket) SetBacklog(value int) error {
return s.SetSockOptInt(BACKLOG, value)
}
// ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc17
//
func (s *Socket) SetMaxMsgSize(value int64) error {
return s.SetSockOptInt64(MAXMSGSIZE, value)
}
// ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc19
//
func (s *Socket) SetRcvTimeout(value time.Duration) error {
return s.SetSockOptInt(RCVTIMEO, int(value/time.Millisecond))
}
// ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc20
//
func (s *Socket) SetSndTimeout(value time.Duration) error {
return s.SetSockOptInt(SNDTIMEO, int(value/time.Millisecond))
}
// ZMQ_IPV4ONLY: Use IPv4-only sockets.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc21
//
func (s *Socket) SetIPv4Only(value bool) error {
if value {
return s.SetSockOptInt(IPV4ONLY, 1)
}
return s.SetSockOptInt(IPV4ONLY, 0)
}
// ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc22
//
func (s *Socket) SetDelayAttachOnConnect(value bool) error {
if value {
return s.SetSockOptInt(DELAY_ATTACH_ON_CONNECT, 1)
}
return s.SetSockOptInt(DELAY_ATTACH_ON_CONNECT, 0)
}
// ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc23
//
func (s *Socket) SetROUTERMandatory(value bool) error {
if value {
return s.SetSockOptInt(ROUTER_MANDATORY, 1)
}
return s.SetSockOptInt(ROUTER_MANDATORY, 0)
}
// ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc24
//
func (s *Socket) SetXPUBVerbose(value bool) error {
if value {
return s.SetSockOptInt(XPUB_VERBOSE, 1)
}
return s.SetSockOptInt(XPUB_VERBOSE, 0)
}
// ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc25
//
func (s *Socket) SetTCPKeepalive(value int) error {
return s.SetSockOptInt(TCP_KEEPALIVE, value)
}
// ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS).
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc26
//
func (s *Socket) SetTCPKeepaliveIdle(value int) error {
return s.SetSockOptInt(TCP_KEEPALIVE_IDLE, value)
}
// ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc27
//
func (s *Socket) SetTCPKeepaliveCnt(value int) error {
return s.SetSockOptInt(TCP_KEEPALIVE_CNT, value)
}
// ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc28
//
func (s *Socket) SetTCPKeepaliveIntvl(value int) error {
return s.SetSockOptInt(TCP_KEEPALIVE_INTVL, value)
}
// ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc29
//
func (s *Socket) SetTCPAcceptFilter(value string) error {
return s.SetSockOptString(TCP_ACCEPT_FILTER, value)
}