rbczmq 1.7.2 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTFkZjRmNzg3MjRiYTliZmZkZjYxYTY0MTU1Y2M5NzM0ZDJhMWM1Yg==
4
+ OTFiODAyNWE1MjM4MGVlODE0YmIxMGQyYTIyOWM3ZDlkNTc0ZWVhMw==
5
5
  data.tar.gz: !binary |-
6
- YWM5YTFmMTBhOWNmMjNjZWY0Y2EzZjM1NTM0MmI2NTc1MDI2MWIyZg==
7
- !binary "U0hBNTEy":
6
+ MjIzNzk5NzE5YWNhMmY3M2U2ODRmNmFmNzYxZmM2YzM4ZDJiMzJlOQ==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- NWM2NzNjZmIyN2I1MzAzMjAwNGZmZDZjNjZmMmU2OWJlNDYyMzRjN2RlNmEx
10
- MTMwZTkwNTIxMjNmZWM5NzkxYjM2MzM4ZWNlNWRlNGI3NzY4MDQzOTViMmQx
11
- NWNlMjQ3YWQ1NTVmMWU5MDk1NjVmNWRlOTA5Mjc4NGE2ZDBkODM=
9
+ NzNhNjFiZjRmNjllZjQyNmVjZjYzNGFmNTE2OGIxOThhNzUyY2NjMzA2NmE3
10
+ OGM1YzY4OTRkYzZhNDZmNjE3MzBmMTM0OTk5NzI5NzdkOTczOWQ5NWI0NjU0
11
+ Y2Q1ZDFmNGNjZDViYTIwZmY0YThlYjEyMTQ5ZjBmMGFiMWQ5OGU=
12
12
  data.tar.gz: !binary |-
13
- MDc4OWZhNjQ0Njk1OTQ4ZDI5MDAxNGI0YjllNWQyNWUwMTllMGJlYjM4N2Fl
14
- ZDQ3MDJlYzRlMDc4NWRiZjU1ZjVlODg0YTBhYjI3NTljOGFlOTc2NjBhN2Jh
15
- NTgwYjcwNGJjZjI2NGExODcyZGMwZDFkMTNkOTI5OTlkYTU1Yzc=
13
+ ZDYxNTQ4MzgxNjhkY2I1OTg3ZTU2MTVkOTliZWQ1Yzg2YTZkNmIwMzU1NTlk
14
+ MmRkNGUyZGRiY2U4Zjk5NTRhZmU1N2U5ZWM3YTIyMzY5ODJmODUyY2FhMWU2
15
+ NTYwZWVlM2E2OTA3NzQ3MjU0YWZiNzMxYjI0ZThlMDY2ZTk5NDQ=
@@ -1,6 +1,6 @@
1
1
  [submodule "ext/zeromq"]
2
2
  path = ext/zeromq
3
- url = https://github.com/zeromq/libzmq
3
+ url = https://github.com/zeromq/zeromq4-x
4
4
  [submodule "ext/czmq"]
5
5
  path = ext/czmq
6
6
  url = https://github.com/zeromq/czmq
@@ -1,5 +1,9 @@
1
1
  = Changelog
2
2
 
3
+ == 1.7.3 (November 11, 2013)
4
+
5
+ * Add an array of poll items to ZMQ::Loop so that they are not garbage collected. #25
6
+
3
7
  == 1.7.2 (October 12, 2013)
4
8
 
5
9
  * Upgrade to libzmq 4.0.1 and czmq 2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbczmq (1.7.1)
4
+ rbczmq (1.7.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -4,7 +4,7 @@
4
4
  use 'gsl sockopts'
5
5
  -->
6
6
  <options script = "sockopts">
7
- <version major = "4" style = "enum">
7
+ <version major = "4" style = "macro">
8
8
  <!-- New names for deprecated 3.x options -->
9
9
  <option name = "ipv6" type = "int" mode = "rw" test = "SUB" />
10
10
  <option name = "immediate" type = "int" mode = "w" test = "DEALER" />
@@ -48,8 +48,10 @@
48
48
  void
49
49
  zsocket_set_ipv6 (void *zocket, int ipv6)
50
50
  {
51
+ # if defined (ZMQ_IPV6)
51
52
  int rc = zmq_setsockopt (zocket, ZMQ_IPV6, &ipv6, sizeof (int));
52
53
  assert (rc == 0 || zmq_errno () == ETERM);
54
+ # endif
53
55
  }
54
56
 
55
57
 
@@ -60,10 +62,14 @@ zsocket_set_ipv6 (void *zocket, int ipv6)
60
62
  int
61
63
  zsocket_ipv6 (void *zocket)
62
64
  {
65
+ # if defined (ZMQ_IPV6)
63
66
  int ipv6;
64
67
  size_t option_len = sizeof (int);
65
68
  zmq_getsockopt (zocket, ZMQ_IPV6, &ipv6, &option_len);
66
69
  return ipv6;
70
+ # else
71
+ return 0;
72
+ # endif
67
73
  }
68
74
 
69
75
 
@@ -74,8 +80,10 @@ zsocket_ipv6 (void *zocket)
74
80
  void
75
81
  zsocket_set_immediate (void *zocket, int immediate)
76
82
  {
83
+ # if defined (ZMQ_IMMEDIATE)
77
84
  int rc = zmq_setsockopt (zocket, ZMQ_IMMEDIATE, &immediate, sizeof (int));
78
85
  assert (rc == 0 || zmq_errno () == ETERM);
86
+ # endif
79
87
  }
80
88
 
81
89
 
@@ -86,12 +94,14 @@ zsocket_set_immediate (void *zocket, int immediate)
86
94
  void
87
95
  zsocket_set_router_raw (void *zocket, int router_raw)
88
96
  {
97
+ # if defined (ZMQ_ROUTER_RAW)
89
98
  if (zsocket_type (zocket) != ZMQ_ROUTER) {
90
99
  printf ("ZMQ_ROUTER_RAW is not valid on %s sockets\n", zsocket_type_str (zocket));
91
100
  assert (false);
92
101
  }
93
102
  int rc = zmq_setsockopt (zocket, ZMQ_ROUTER_RAW, &router_raw, sizeof (int));
94
103
  assert (rc == 0 || zmq_errno () == ETERM);
104
+ # endif
95
105
  }
96
106
 
97
107
 
@@ -102,8 +112,10 @@ zsocket_set_router_raw (void *zocket, int router_raw)
102
112
  void
103
113
  zsocket_set_ipv4only (void *zocket, int ipv4only)
104
114
  {
115
+ # if defined (ZMQ_IPV4ONLY)
105
116
  int rc = zmq_setsockopt (zocket, ZMQ_IPV4ONLY, &ipv4only, sizeof (int));
106
117
  assert (rc == 0 || zmq_errno () == ETERM);
118
+ # endif
107
119
  }
108
120
 
109
121
 
@@ -114,10 +126,14 @@ zsocket_set_ipv4only (void *zocket, int ipv4only)
114
126
  int
115
127
  zsocket_ipv4only (void *zocket)
116
128
  {
129
+ # if defined (ZMQ_IPV4ONLY)
117
130
  int ipv4only;
118
131
  size_t option_len = sizeof (int);
119
132
  zmq_getsockopt (zocket, ZMQ_IPV4ONLY, &ipv4only, &option_len);
120
133
  return ipv4only;
134
+ # else
135
+ return 0;
136
+ # endif
121
137
  }
122
138
 
123
139
 
@@ -128,8 +144,10 @@ zsocket_ipv4only (void *zocket)
128
144
  void
129
145
  zsocket_set_delay_attach_on_connect (void *zocket, int delay_attach_on_connect)
130
146
  {
147
+ # if defined (ZMQ_DELAY_ATTACH_ON_CONNECT)
131
148
  int rc = zmq_setsockopt (zocket, ZMQ_DELAY_ATTACH_ON_CONNECT, &delay_attach_on_connect, sizeof (int));
132
149
  assert (rc == 0 || zmq_errno () == ETERM);
150
+ # endif
133
151
  }
134
152
 
135
153
 
@@ -140,12 +158,14 @@ zsocket_set_delay_attach_on_connect (void *zocket, int delay_attach_on_connect)
140
158
  void
141
159
  zsocket_set_router_mandatory (void *zocket, int router_mandatory)
142
160
  {
161
+ # if defined (ZMQ_ROUTER_MANDATORY)
143
162
  if (zsocket_type (zocket) != ZMQ_ROUTER) {
144
163
  printf ("ZMQ_ROUTER_MANDATORY is not valid on %s sockets\n", zsocket_type_str (zocket));
145
164
  assert (false);
146
165
  }
147
166
  int rc = zmq_setsockopt (zocket, ZMQ_ROUTER_MANDATORY, &router_mandatory, sizeof (int));
148
167
  assert (rc == 0 || zmq_errno () == ETERM);
168
+ # endif
149
169
  }
150
170
 
151
171
 
@@ -156,10 +176,14 @@ zsocket_set_router_mandatory (void *zocket, int router_mandatory)
156
176
  int
157
177
  zsocket_probe_router (void *zocket)
158
178
  {
179
+ # if defined (ZMQ_PROBE_ROUTER)
159
180
  int probe_router;
160
181
  size_t option_len = sizeof (int);
161
182
  zmq_getsockopt (zocket, ZMQ_PROBE_ROUTER, &probe_router, &option_len);
162
183
  return probe_router;
184
+ # else
185
+ return 0;
186
+ # endif
163
187
  }
164
188
 
165
189
 
@@ -170,12 +194,14 @@ zsocket_probe_router (void *zocket)
170
194
  void
171
195
  zsocket_set_req_relaxed (void *zocket, int req_relaxed)
172
196
  {
197
+ # if defined (ZMQ_REQ_RELAXED)
173
198
  if (zsocket_type (zocket) != ZMQ_REQ) {
174
199
  printf ("ZMQ_REQ_RELAXED is not valid on %s sockets\n", zsocket_type_str (zocket));
175
200
  assert (false);
176
201
  }
177
202
  int rc = zmq_setsockopt (zocket, ZMQ_REQ_RELAXED, &req_relaxed, sizeof (int));
178
203
  assert (rc == 0 || zmq_errno () == ETERM);
204
+ # endif
179
205
  }
180
206
 
181
207
 
@@ -186,12 +212,14 @@ zsocket_set_req_relaxed (void *zocket, int req_relaxed)
186
212
  void
187
213
  zsocket_set_req_correlate (void *zocket, int req_correlate)
188
214
  {
215
+ # if defined (ZMQ_REQ_CORRELATE)
189
216
  if (zsocket_type (zocket) != ZMQ_REQ) {
190
217
  printf ("ZMQ_REQ_CORRELATE is not valid on %s sockets\n", zsocket_type_str (zocket));
191
218
  assert (false);
192
219
  }
193
220
  int rc = zmq_setsockopt (zocket, ZMQ_REQ_CORRELATE, &req_correlate, sizeof (int));
194
221
  assert (rc == 0 || zmq_errno () == ETERM);
222
+ # endif
195
223
  }
196
224
 
197
225
 
@@ -202,6 +230,7 @@ zsocket_set_req_correlate (void *zocket, int req_correlate)
202
230
  void
203
231
  zsocket_set_conflate (void *zocket, int conflate)
204
232
  {
233
+ # if defined (ZMQ_CONFLATE)
205
234
  if (zsocket_type (zocket) != ZMQ_PUSH
206
235
  && zsocket_type (zocket) != ZMQ_PULL
207
236
  && zsocket_type (zocket) != ZMQ_PUB
@@ -212,6 +241,7 @@ zsocket_set_conflate (void *zocket, int conflate)
212
241
  }
213
242
  int rc = zmq_setsockopt (zocket, ZMQ_CONFLATE, &conflate, sizeof (int));
214
243
  assert (rc == 0 || zmq_errno () == ETERM);
244
+ # endif
215
245
  }
216
246
 
217
247
 
@@ -222,8 +252,10 @@ zsocket_set_conflate (void *zocket, int conflate)
222
252
  void
223
253
  zsocket_set_plain_server (void *zocket, int plain_server)
224
254
  {
255
+ # if defined (ZMQ_PLAIN_SERVER)
225
256
  int rc = zmq_setsockopt (zocket, ZMQ_PLAIN_SERVER, &plain_server, sizeof (int));
226
257
  assert (rc == 0 || zmq_errno () == ETERM);
258
+ # endif
227
259
  }
228
260
 
229
261
 
@@ -234,10 +266,14 @@ zsocket_set_plain_server (void *zocket, int plain_server)
234
266
  int
235
267
  zsocket_plain_server (void *zocket)
236
268
  {
269
+ # if defined (ZMQ_PLAIN_SERVER)
237
270
  int plain_server;
238
271
  size_t option_len = sizeof (int);
239
272
  zmq_getsockopt (zocket, ZMQ_PLAIN_SERVER, &plain_server, &option_len);
240
273
  return plain_server;
274
+ # else
275
+ return 0;
276
+ # endif
241
277
  }
242
278
 
243
279
 
@@ -248,8 +284,10 @@ zsocket_plain_server (void *zocket)
248
284
  void
249
285
  zsocket_set_plain_username (void *zocket, const char * plain_username)
250
286
  {
287
+ # if defined (ZMQ_PLAIN_USERNAME)
251
288
  int rc = zmq_setsockopt (zocket, ZMQ_PLAIN_USERNAME, plain_username, strlen (plain_username));
252
289
  assert (rc == 0 || zmq_errno () == ETERM);
290
+ # endif
253
291
  }
254
292
 
255
293
 
@@ -260,10 +298,14 @@ zsocket_set_plain_username (void *zocket, const char * plain_username)
260
298
  char *
261
299
  zsocket_plain_username (void *zocket)
262
300
  {
301
+ # if defined (ZMQ_PLAIN_USERNAME)
263
302
  size_t option_len = 255;
264
303
  char *plain_username = (char *) zmalloc (option_len);
265
304
  zmq_getsockopt (zocket, ZMQ_PLAIN_USERNAME, plain_username, &option_len);
266
305
  return (char *) plain_username;
306
+ # else
307
+ return NULL;
308
+ # endif
267
309
  }
268
310
 
269
311
 
@@ -274,8 +316,10 @@ zsocket_plain_username (void *zocket)
274
316
  void
275
317
  zsocket_set_plain_password (void *zocket, const char * plain_password)
276
318
  {
319
+ # if defined (ZMQ_PLAIN_PASSWORD)
277
320
  int rc = zmq_setsockopt (zocket, ZMQ_PLAIN_PASSWORD, plain_password, strlen (plain_password));
278
321
  assert (rc == 0 || zmq_errno () == ETERM);
322
+ # endif
279
323
  }
280
324
 
281
325
 
@@ -286,10 +330,14 @@ zsocket_set_plain_password (void *zocket, const char * plain_password)
286
330
  char *
287
331
  zsocket_plain_password (void *zocket)
288
332
  {
333
+ # if defined (ZMQ_PLAIN_PASSWORD)
289
334
  size_t option_len = 255;
290
335
  char *plain_password = (char *) zmalloc (option_len);
291
336
  zmq_getsockopt (zocket, ZMQ_PLAIN_PASSWORD, plain_password, &option_len);
292
337
  return (char *) plain_password;
338
+ # else
339
+ return NULL;
340
+ # endif
293
341
  }
294
342
 
295
343
 
@@ -300,10 +348,12 @@ zsocket_plain_password (void *zocket)
300
348
  void
301
349
  zsocket_set_curve_server (void *zocket, int curve_server)
302
350
  {
351
+ # if defined (ZMQ_CURVE_SERVER)
303
352
  # if defined (HAVE_LIBSODIUM)
304
353
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_SERVER, &curve_server, sizeof (int));
305
354
  assert (rc == 0 || zmq_errno () == ETERM);
306
355
  # endif
356
+ # endif
307
357
  }
308
358
 
309
359
 
@@ -314,10 +364,14 @@ zsocket_set_curve_server (void *zocket, int curve_server)
314
364
  int
315
365
  zsocket_curve_server (void *zocket)
316
366
  {
367
+ # if defined (ZMQ_CURVE_SERVER)
317
368
  int curve_server;
318
369
  size_t option_len = sizeof (int);
319
370
  zmq_getsockopt (zocket, ZMQ_CURVE_SERVER, &curve_server, &option_len);
320
371
  return curve_server;
372
+ # else
373
+ return 0;
374
+ # endif
321
375
  }
322
376
 
323
377
 
@@ -328,10 +382,12 @@ zsocket_curve_server (void *zocket)
328
382
  void
329
383
  zsocket_set_curve_publickey (void *zocket, const char * curve_publickey)
330
384
  {
385
+ # if defined (ZMQ_CURVE_PUBLICKEY)
331
386
  # if defined (HAVE_LIBSODIUM)
332
387
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_PUBLICKEY, curve_publickey, strlen (curve_publickey));
333
388
  assert (rc == 0 || zmq_errno () == ETERM);
334
389
  # endif
390
+ # endif
335
391
  }
336
392
 
337
393
 
@@ -342,10 +398,12 @@ zsocket_set_curve_publickey (void *zocket, const char * curve_publickey)
342
398
  void
343
399
  zsocket_set_curve_publickey_bin (void *zocket, const byte *curve_publickey)
344
400
  {
401
+ # if defined (ZMQ_CURVE_PUBLICKEY)
345
402
  # if defined (HAVE_LIBSODIUM)
346
403
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_PUBLICKEY, curve_publickey, 32);
347
404
  assert (rc == 0 || zmq_errno () == ETERM);
348
405
  # endif
406
+ # endif
349
407
  }
350
408
 
351
409
 
@@ -356,10 +414,14 @@ zsocket_set_curve_publickey_bin (void *zocket, const byte *curve_publickey)
356
414
  char *
357
415
  zsocket_curve_publickey (void *zocket)
358
416
  {
417
+ # if defined (ZMQ_CURVE_PUBLICKEY)
359
418
  size_t option_len = 255;
360
419
  char *curve_publickey = (char *) zmalloc (option_len);
361
420
  zmq_getsockopt (zocket, ZMQ_CURVE_PUBLICKEY, curve_publickey, &option_len);
362
421
  return (char *) curve_publickey;
422
+ # else
423
+ return NULL;
424
+ # endif
363
425
  }
364
426
 
365
427
 
@@ -370,10 +432,12 @@ zsocket_curve_publickey (void *zocket)
370
432
  void
371
433
  zsocket_set_curve_secretkey (void *zocket, const char * curve_secretkey)
372
434
  {
435
+ # if defined (ZMQ_CURVE_SECRETKEY)
373
436
  # if defined (HAVE_LIBSODIUM)
374
437
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_SECRETKEY, curve_secretkey, strlen (curve_secretkey));
375
438
  assert (rc == 0 || zmq_errno () == ETERM);
376
439
  # endif
440
+ # endif
377
441
  }
378
442
 
379
443
 
@@ -384,10 +448,12 @@ zsocket_set_curve_secretkey (void *zocket, const char * curve_secretkey)
384
448
  void
385
449
  zsocket_set_curve_secretkey_bin (void *zocket, const byte *curve_secretkey)
386
450
  {
451
+ # if defined (ZMQ_CURVE_SECRETKEY)
387
452
  # if defined (HAVE_LIBSODIUM)
388
453
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_SECRETKEY, curve_secretkey, 32);
389
454
  assert (rc == 0 || zmq_errno () == ETERM);
390
455
  # endif
456
+ # endif
391
457
  }
392
458
 
393
459
 
@@ -398,10 +464,14 @@ zsocket_set_curve_secretkey_bin (void *zocket, const byte *curve_secretkey)
398
464
  char *
399
465
  zsocket_curve_secretkey (void *zocket)
400
466
  {
467
+ # if defined (ZMQ_CURVE_SECRETKEY)
401
468
  size_t option_len = 255;
402
469
  char *curve_secretkey = (char *) zmalloc (option_len);
403
470
  zmq_getsockopt (zocket, ZMQ_CURVE_SECRETKEY, curve_secretkey, &option_len);
404
471
  return (char *) curve_secretkey;
472
+ # else
473
+ return NULL;
474
+ # endif
405
475
  }
406
476
 
407
477
 
@@ -412,10 +482,12 @@ zsocket_curve_secretkey (void *zocket)
412
482
  void
413
483
  zsocket_set_curve_serverkey (void *zocket, const char * curve_serverkey)
414
484
  {
485
+ # if defined (ZMQ_CURVE_SERVERKEY)
415
486
  # if defined (HAVE_LIBSODIUM)
416
487
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_SERVERKEY, curve_serverkey, strlen (curve_serverkey));
417
488
  assert (rc == 0 || zmq_errno () == ETERM);
418
489
  # endif
490
+ # endif
419
491
  }
420
492
 
421
493
 
@@ -426,10 +498,12 @@ zsocket_set_curve_serverkey (void *zocket, const char * curve_serverkey)
426
498
  void
427
499
  zsocket_set_curve_serverkey_bin (void *zocket, const byte *curve_serverkey)
428
500
  {
501
+ # if defined (ZMQ_CURVE_SERVERKEY)
429
502
  # if defined (HAVE_LIBSODIUM)
430
503
  int rc = zmq_setsockopt (zocket, ZMQ_CURVE_SERVERKEY, curve_serverkey, 32);
431
504
  assert (rc == 0 || zmq_errno () == ETERM);
432
505
  # endif
506
+ # endif
433
507
  }
434
508
 
435
509
 
@@ -440,10 +514,14 @@ zsocket_set_curve_serverkey_bin (void *zocket, const byte *curve_serverkey)
440
514
  char *
441
515
  zsocket_curve_serverkey (void *zocket)
442
516
  {
517
+ # if defined (ZMQ_CURVE_SERVERKEY)
443
518
  size_t option_len = 255;
444
519
  char *curve_serverkey = (char *) zmalloc (option_len);
445
520
  zmq_getsockopt (zocket, ZMQ_CURVE_SERVERKEY, curve_serverkey, &option_len);
446
521
  return (char *) curve_serverkey;
522
+ # else
523
+ return NULL;
524
+ # endif
447
525
  }
448
526
 
449
527
 
@@ -454,8 +532,10 @@ zsocket_curve_serverkey (void *zocket)
454
532
  void
455
533
  zsocket_set_zap_domain (void *zocket, const char * zap_domain)
456
534
  {
535
+ # if defined (ZMQ_ZAP_DOMAIN)
457
536
  int rc = zmq_setsockopt (zocket, ZMQ_ZAP_DOMAIN, zap_domain, strlen (zap_domain));
458
537
  assert (rc == 0 || zmq_errno () == ETERM);
538
+ # endif
459
539
  }
460
540
 
461
541
 
@@ -466,10 +546,14 @@ zsocket_set_zap_domain (void *zocket, const char * zap_domain)
466
546
  char *
467
547
  zsocket_zap_domain (void *zocket)
468
548
  {
549
+ # if defined (ZMQ_ZAP_DOMAIN)
469
550
  size_t option_len = 255;
470
551
  char *zap_domain = (char *) zmalloc (option_len);
471
552
  zmq_getsockopt (zocket, ZMQ_ZAP_DOMAIN, zap_domain, &option_len);
472
553
  return (char *) zap_domain;
554
+ # else
555
+ return NULL;
556
+ # endif
473
557
  }
474
558
 
475
559
 
@@ -480,10 +564,14 @@ zsocket_zap_domain (void *zocket)
480
564
  int
481
565
  zsocket_type (void *zocket)
482
566
  {
567
+ # if defined (ZMQ_TYPE)
483
568
  int type;
484
569
  size_t option_len = sizeof (int);
485
570
  zmq_getsockopt (zocket, ZMQ_TYPE, &type, &option_len);
486
571
  return type;
572
+ # else
573
+ return 0;
574
+ # endif
487
575
  }
488
576
 
489
577
 
@@ -494,8 +582,10 @@ zsocket_type (void *zocket)
494
582
  void
495
583
  zsocket_set_sndhwm (void *zocket, int sndhwm)
496
584
  {
585
+ # if defined (ZMQ_SNDHWM)
497
586
  int rc = zmq_setsockopt (zocket, ZMQ_SNDHWM, &sndhwm, sizeof (int));
498
587
  assert (rc == 0 || zmq_errno () == ETERM);
588
+ # endif
499
589
  }
500
590
 
501
591
 
@@ -506,10 +596,14 @@ zsocket_set_sndhwm (void *zocket, int sndhwm)
506
596
  int
507
597
  zsocket_sndhwm (void *zocket)
508
598
  {
599
+ # if defined (ZMQ_SNDHWM)
509
600
  int sndhwm;
510
601
  size_t option_len = sizeof (int);
511
602
  zmq_getsockopt (zocket, ZMQ_SNDHWM, &sndhwm, &option_len);
512
603
  return sndhwm;
604
+ # else
605
+ return 0;
606
+ # endif
513
607
  }
514
608
 
515
609
 
@@ -520,8 +614,10 @@ zsocket_sndhwm (void *zocket)
520
614
  void
521
615
  zsocket_set_rcvhwm (void *zocket, int rcvhwm)
522
616
  {
617
+ # if defined (ZMQ_RCVHWM)
523
618
  int rc = zmq_setsockopt (zocket, ZMQ_RCVHWM, &rcvhwm, sizeof (int));
524
619
  assert (rc == 0 || zmq_errno () == ETERM);
620
+ # endif
525
621
  }
526
622
 
527
623
 
@@ -532,10 +628,14 @@ zsocket_set_rcvhwm (void *zocket, int rcvhwm)
532
628
  int
533
629
  zsocket_rcvhwm (void *zocket)
534
630
  {
631
+ # if defined (ZMQ_RCVHWM)
535
632
  int rcvhwm;
536
633
  size_t option_len = sizeof (int);
537
634
  zmq_getsockopt (zocket, ZMQ_RCVHWM, &rcvhwm, &option_len);
538
635
  return rcvhwm;
636
+ # else
637
+ return 0;
638
+ # endif
539
639
  }
540
640
 
541
641
 
@@ -546,9 +646,11 @@ zsocket_rcvhwm (void *zocket)
546
646
  void
547
647
  zsocket_set_affinity (void *zocket, int affinity)
548
648
  {
649
+ # if defined (ZMQ_AFFINITY)
549
650
  uint64_t value = affinity;
550
651
  int rc = zmq_setsockopt (zocket, ZMQ_AFFINITY, &value, sizeof (uint64_t));
551
652
  assert (rc == 0 || zmq_errno () == ETERM);
653
+ # endif
552
654
  }
553
655
 
554
656
 
@@ -559,10 +661,14 @@ zsocket_set_affinity (void *zocket, int affinity)
559
661
  int
560
662
  zsocket_affinity (void *zocket)
561
663
  {
664
+ # if defined (ZMQ_AFFINITY)
562
665
  uint64_t affinity;
563
666
  size_t option_len = sizeof (uint64_t);
564
667
  zmq_getsockopt (zocket, ZMQ_AFFINITY, &affinity, &option_len);
565
668
  return (int) affinity;
669
+ # else
670
+ return 0;
671
+ # endif
566
672
  }
567
673
 
568
674
 
@@ -573,12 +679,14 @@ zsocket_affinity (void *zocket)
573
679
  void
574
680
  zsocket_set_subscribe (void *zocket, const char * subscribe)
575
681
  {
682
+ # if defined (ZMQ_SUBSCRIBE)
576
683
  if (zsocket_type (zocket) != ZMQ_SUB) {
577
684
  printf ("ZMQ_SUBSCRIBE is not valid on %s sockets\n", zsocket_type_str (zocket));
578
685
  assert (false);
579
686
  }
580
687
  int rc = zmq_setsockopt (zocket, ZMQ_SUBSCRIBE, subscribe, strlen (subscribe));
581
688
  assert (rc == 0 || zmq_errno () == ETERM);
689
+ # endif
582
690
  }
583
691
 
584
692
 
@@ -589,12 +697,14 @@ zsocket_set_subscribe (void *zocket, const char * subscribe)
589
697
  void
590
698
  zsocket_set_unsubscribe (void *zocket, const char * unsubscribe)
591
699
  {
700
+ # if defined (ZMQ_UNSUBSCRIBE)
592
701
  if (zsocket_type (zocket) != ZMQ_SUB) {
593
702
  printf ("ZMQ_UNSUBSCRIBE is not valid on %s sockets\n", zsocket_type_str (zocket));
594
703
  assert (false);
595
704
  }
596
705
  int rc = zmq_setsockopt (zocket, ZMQ_UNSUBSCRIBE, unsubscribe, strlen (unsubscribe));
597
706
  assert (rc == 0 || zmq_errno () == ETERM);
707
+ # endif
598
708
  }
599
709
 
600
710
 
@@ -605,6 +715,7 @@ zsocket_set_unsubscribe (void *zocket, const char * unsubscribe)
605
715
  void
606
716
  zsocket_set_identity (void *zocket, const char * identity)
607
717
  {
718
+ # if defined (ZMQ_IDENTITY)
608
719
  if (zsocket_type (zocket) != ZMQ_REQ
609
720
  && zsocket_type (zocket) != ZMQ_REP
610
721
  && zsocket_type (zocket) != ZMQ_DEALER
@@ -615,6 +726,7 @@ zsocket_set_identity (void *zocket, const char * identity)
615
726
  }
616
727
  int rc = zmq_setsockopt (zocket, ZMQ_IDENTITY, identity, strlen (identity));
617
728
  assert (rc == 0 || zmq_errno () == ETERM);
729
+ # endif
618
730
  }
619
731
 
620
732
 
@@ -625,10 +737,14 @@ zsocket_set_identity (void *zocket, const char * identity)
625
737
  char *
626
738
  zsocket_identity (void *zocket)
627
739
  {
740
+ # if defined (ZMQ_IDENTITY)
628
741
  size_t option_len = 255;
629
742
  char *identity = (char *) zmalloc (option_len);
630
743
  zmq_getsockopt (zocket, ZMQ_IDENTITY, identity, &option_len);
631
744
  return (char *) identity;
745
+ # else
746
+ return NULL;
747
+ # endif
632
748
  }
633
749
 
634
750
 
@@ -639,8 +755,10 @@ zsocket_identity (void *zocket)
639
755
  void
640
756
  zsocket_set_rate (void *zocket, int rate)
641
757
  {
758
+ # if defined (ZMQ_RATE)
642
759
  int rc = zmq_setsockopt (zocket, ZMQ_RATE, &rate, sizeof (int));
643
760
  assert (rc == 0 || zmq_errno () == ETERM);
761
+ # endif
644
762
  }
645
763
 
646
764
 
@@ -651,10 +769,14 @@ zsocket_set_rate (void *zocket, int rate)
651
769
  int
652
770
  zsocket_rate (void *zocket)
653
771
  {
772
+ # if defined (ZMQ_RATE)
654
773
  int rate;
655
774
  size_t option_len = sizeof (int);
656
775
  zmq_getsockopt (zocket, ZMQ_RATE, &rate, &option_len);
657
776
  return rate;
777
+ # else
778
+ return 0;
779
+ # endif
658
780
  }
659
781
 
660
782
 
@@ -665,8 +787,10 @@ zsocket_rate (void *zocket)
665
787
  void
666
788
  zsocket_set_recovery_ivl (void *zocket, int recovery_ivl)
667
789
  {
790
+ # if defined (ZMQ_RECOVERY_IVL)
668
791
  int rc = zmq_setsockopt (zocket, ZMQ_RECOVERY_IVL, &recovery_ivl, sizeof (int));
669
792
  assert (rc == 0 || zmq_errno () == ETERM);
793
+ # endif
670
794
  }
671
795
 
672
796
 
@@ -677,10 +801,14 @@ zsocket_set_recovery_ivl (void *zocket, int recovery_ivl)
677
801
  int
678
802
  zsocket_recovery_ivl (void *zocket)
679
803
  {
804
+ # if defined (ZMQ_RECOVERY_IVL)
680
805
  int recovery_ivl;
681
806
  size_t option_len = sizeof (int);
682
807
  zmq_getsockopt (zocket, ZMQ_RECOVERY_IVL, &recovery_ivl, &option_len);
683
808
  return recovery_ivl;
809
+ # else
810
+ return 0;
811
+ # endif
684
812
  }
685
813
 
686
814
 
@@ -691,8 +819,10 @@ zsocket_recovery_ivl (void *zocket)
691
819
  void
692
820
  zsocket_set_sndbuf (void *zocket, int sndbuf)
693
821
  {
822
+ # if defined (ZMQ_SNDBUF)
694
823
  int rc = zmq_setsockopt (zocket, ZMQ_SNDBUF, &sndbuf, sizeof (int));
695
824
  assert (rc == 0 || zmq_errno () == ETERM);
825
+ # endif
696
826
  }
697
827
 
698
828
 
@@ -703,10 +833,14 @@ zsocket_set_sndbuf (void *zocket, int sndbuf)
703
833
  int
704
834
  zsocket_sndbuf (void *zocket)
705
835
  {
836
+ # if defined (ZMQ_SNDBUF)
706
837
  int sndbuf;
707
838
  size_t option_len = sizeof (int);
708
839
  zmq_getsockopt (zocket, ZMQ_SNDBUF, &sndbuf, &option_len);
709
840
  return sndbuf;
841
+ # else
842
+ return 0;
843
+ # endif
710
844
  }
711
845
 
712
846
 
@@ -717,8 +851,10 @@ zsocket_sndbuf (void *zocket)
717
851
  void
718
852
  zsocket_set_rcvbuf (void *zocket, int rcvbuf)
719
853
  {
854
+ # if defined (ZMQ_RCVBUF)
720
855
  int rc = zmq_setsockopt (zocket, ZMQ_RCVBUF, &rcvbuf, sizeof (int));
721
856
  assert (rc == 0 || zmq_errno () == ETERM);
857
+ # endif
722
858
  }
723
859
 
724
860
 
@@ -729,10 +865,14 @@ zsocket_set_rcvbuf (void *zocket, int rcvbuf)
729
865
  int
730
866
  zsocket_rcvbuf (void *zocket)
731
867
  {
868
+ # if defined (ZMQ_RCVBUF)
732
869
  int rcvbuf;
733
870
  size_t option_len = sizeof (int);
734
871
  zmq_getsockopt (zocket, ZMQ_RCVBUF, &rcvbuf, &option_len);
735
872
  return rcvbuf;
873
+ # else
874
+ return 0;
875
+ # endif
736
876
  }
737
877
 
738
878
 
@@ -743,8 +883,10 @@ zsocket_rcvbuf (void *zocket)
743
883
  void
744
884
  zsocket_set_linger (void *zocket, int linger)
745
885
  {
886
+ # if defined (ZMQ_LINGER)
746
887
  int rc = zmq_setsockopt (zocket, ZMQ_LINGER, &linger, sizeof (int));
747
888
  assert (rc == 0 || zmq_errno () == ETERM);
889
+ # endif
748
890
  }
749
891
 
750
892
 
@@ -755,10 +897,14 @@ zsocket_set_linger (void *zocket, int linger)
755
897
  int
756
898
  zsocket_linger (void *zocket)
757
899
  {
900
+ # if defined (ZMQ_LINGER)
758
901
  int linger;
759
902
  size_t option_len = sizeof (int);
760
903
  zmq_getsockopt (zocket, ZMQ_LINGER, &linger, &option_len);
761
904
  return linger;
905
+ # else
906
+ return 0;
907
+ # endif
762
908
  }
763
909
 
764
910
 
@@ -769,8 +915,10 @@ zsocket_linger (void *zocket)
769
915
  void
770
916
  zsocket_set_reconnect_ivl (void *zocket, int reconnect_ivl)
771
917
  {
918
+ # if defined (ZMQ_RECONNECT_IVL)
772
919
  int rc = zmq_setsockopt (zocket, ZMQ_RECONNECT_IVL, &reconnect_ivl, sizeof (int));
773
920
  assert (rc == 0 || zmq_errno () == ETERM);
921
+ # endif
774
922
  }
775
923
 
776
924
 
@@ -781,10 +929,14 @@ zsocket_set_reconnect_ivl (void *zocket, int reconnect_ivl)
781
929
  int
782
930
  zsocket_reconnect_ivl (void *zocket)
783
931
  {
932
+ # if defined (ZMQ_RECONNECT_IVL)
784
933
  int reconnect_ivl;
785
934
  size_t option_len = sizeof (int);
786
935
  zmq_getsockopt (zocket, ZMQ_RECONNECT_IVL, &reconnect_ivl, &option_len);
787
936
  return reconnect_ivl;
937
+ # else
938
+ return 0;
939
+ # endif
788
940
  }
789
941
 
790
942
 
@@ -795,8 +947,10 @@ zsocket_reconnect_ivl (void *zocket)
795
947
  void
796
948
  zsocket_set_reconnect_ivl_max (void *zocket, int reconnect_ivl_max)
797
949
  {
950
+ # if defined (ZMQ_RECONNECT_IVL_MAX)
798
951
  int rc = zmq_setsockopt (zocket, ZMQ_RECONNECT_IVL_MAX, &reconnect_ivl_max, sizeof (int));
799
952
  assert (rc == 0 || zmq_errno () == ETERM);
953
+ # endif
800
954
  }
801
955
 
802
956
 
@@ -807,10 +961,14 @@ zsocket_set_reconnect_ivl_max (void *zocket, int reconnect_ivl_max)
807
961
  int
808
962
  zsocket_reconnect_ivl_max (void *zocket)
809
963
  {
964
+ # if defined (ZMQ_RECONNECT_IVL_MAX)
810
965
  int reconnect_ivl_max;
811
966
  size_t option_len = sizeof (int);
812
967
  zmq_getsockopt (zocket, ZMQ_RECONNECT_IVL_MAX, &reconnect_ivl_max, &option_len);
813
968
  return reconnect_ivl_max;
969
+ # else
970
+ return 0;
971
+ # endif
814
972
  }
815
973
 
816
974
 
@@ -821,8 +979,10 @@ zsocket_reconnect_ivl_max (void *zocket)
821
979
  void
822
980
  zsocket_set_backlog (void *zocket, int backlog)
823
981
  {
982
+ # if defined (ZMQ_BACKLOG)
824
983
  int rc = zmq_setsockopt (zocket, ZMQ_BACKLOG, &backlog, sizeof (int));
825
984
  assert (rc == 0 || zmq_errno () == ETERM);
985
+ # endif
826
986
  }
827
987
 
828
988
 
@@ -833,10 +993,14 @@ zsocket_set_backlog (void *zocket, int backlog)
833
993
  int
834
994
  zsocket_backlog (void *zocket)
835
995
  {
996
+ # if defined (ZMQ_BACKLOG)
836
997
  int backlog;
837
998
  size_t option_len = sizeof (int);
838
999
  zmq_getsockopt (zocket, ZMQ_BACKLOG, &backlog, &option_len);
839
1000
  return backlog;
1001
+ # else
1002
+ return 0;
1003
+ # endif
840
1004
  }
841
1005
 
842
1006
 
@@ -847,9 +1011,11 @@ zsocket_backlog (void *zocket)
847
1011
  void
848
1012
  zsocket_set_maxmsgsize (void *zocket, int maxmsgsize)
849
1013
  {
1014
+ # if defined (ZMQ_MAXMSGSIZE)
850
1015
  int64_t value = maxmsgsize;
851
1016
  int rc = zmq_setsockopt (zocket, ZMQ_MAXMSGSIZE, &value, sizeof (int64_t));
852
1017
  assert (rc == 0 || zmq_errno () == ETERM);
1018
+ # endif
853
1019
  }
854
1020
 
855
1021
 
@@ -860,10 +1026,14 @@ zsocket_set_maxmsgsize (void *zocket, int maxmsgsize)
860
1026
  int
861
1027
  zsocket_maxmsgsize (void *zocket)
862
1028
  {
1029
+ # if defined (ZMQ_MAXMSGSIZE)
863
1030
  int64_t maxmsgsize;
864
1031
  size_t option_len = sizeof (int64_t);
865
1032
  zmq_getsockopt (zocket, ZMQ_MAXMSGSIZE, &maxmsgsize, &option_len);
866
1033
  return (int) maxmsgsize;
1034
+ # else
1035
+ return 0;
1036
+ # endif
867
1037
  }
868
1038
 
869
1039
 
@@ -874,8 +1044,10 @@ zsocket_maxmsgsize (void *zocket)
874
1044
  void
875
1045
  zsocket_set_multicast_hops (void *zocket, int multicast_hops)
876
1046
  {
1047
+ # if defined (ZMQ_MULTICAST_HOPS)
877
1048
  int rc = zmq_setsockopt (zocket, ZMQ_MULTICAST_HOPS, &multicast_hops, sizeof (int));
878
1049
  assert (rc == 0 || zmq_errno () == ETERM);
1050
+ # endif
879
1051
  }
880
1052
 
881
1053
 
@@ -886,10 +1058,14 @@ zsocket_set_multicast_hops (void *zocket, int multicast_hops)
886
1058
  int
887
1059
  zsocket_multicast_hops (void *zocket)
888
1060
  {
1061
+ # if defined (ZMQ_MULTICAST_HOPS)
889
1062
  int multicast_hops;
890
1063
  size_t option_len = sizeof (int);
891
1064
  zmq_getsockopt (zocket, ZMQ_MULTICAST_HOPS, &multicast_hops, &option_len);
892
1065
  return multicast_hops;
1066
+ # else
1067
+ return 0;
1068
+ # endif
893
1069
  }
894
1070
 
895
1071
 
@@ -900,8 +1076,10 @@ zsocket_multicast_hops (void *zocket)
900
1076
  void
901
1077
  zsocket_set_rcvtimeo (void *zocket, int rcvtimeo)
902
1078
  {
1079
+ # if defined (ZMQ_RCVTIMEO)
903
1080
  int rc = zmq_setsockopt (zocket, ZMQ_RCVTIMEO, &rcvtimeo, sizeof (int));
904
1081
  assert (rc == 0 || zmq_errno () == ETERM);
1082
+ # endif
905
1083
  }
906
1084
 
907
1085
 
@@ -912,10 +1090,14 @@ zsocket_set_rcvtimeo (void *zocket, int rcvtimeo)
912
1090
  int
913
1091
  zsocket_rcvtimeo (void *zocket)
914
1092
  {
1093
+ # if defined (ZMQ_RCVTIMEO)
915
1094
  int rcvtimeo;
916
1095
  size_t option_len = sizeof (int);
917
1096
  zmq_getsockopt (zocket, ZMQ_RCVTIMEO, &rcvtimeo, &option_len);
918
1097
  return rcvtimeo;
1098
+ # else
1099
+ return 0;
1100
+ # endif
919
1101
  }
920
1102
 
921
1103
 
@@ -926,8 +1108,10 @@ zsocket_rcvtimeo (void *zocket)
926
1108
  void
927
1109
  zsocket_set_sndtimeo (void *zocket, int sndtimeo)
928
1110
  {
1111
+ # if defined (ZMQ_SNDTIMEO)
929
1112
  int rc = zmq_setsockopt (zocket, ZMQ_SNDTIMEO, &sndtimeo, sizeof (int));
930
1113
  assert (rc == 0 || zmq_errno () == ETERM);
1114
+ # endif
931
1115
  }
932
1116
 
933
1117
 
@@ -938,10 +1122,14 @@ zsocket_set_sndtimeo (void *zocket, int sndtimeo)
938
1122
  int
939
1123
  zsocket_sndtimeo (void *zocket)
940
1124
  {
1125
+ # if defined (ZMQ_SNDTIMEO)
941
1126
  int sndtimeo;
942
1127
  size_t option_len = sizeof (int);
943
1128
  zmq_getsockopt (zocket, ZMQ_SNDTIMEO, &sndtimeo, &option_len);
944
1129
  return sndtimeo;
1130
+ # else
1131
+ return 0;
1132
+ # endif
945
1133
  }
946
1134
 
947
1135
 
@@ -952,12 +1140,14 @@ zsocket_sndtimeo (void *zocket)
952
1140
  void
953
1141
  zsocket_set_xpub_verbose (void *zocket, int xpub_verbose)
954
1142
  {
1143
+ # if defined (ZMQ_XPUB_VERBOSE)
955
1144
  if (zsocket_type (zocket) != ZMQ_XPUB) {
956
1145
  printf ("ZMQ_XPUB_VERBOSE is not valid on %s sockets\n", zsocket_type_str (zocket));
957
1146
  assert (false);
958
1147
  }
959
1148
  int rc = zmq_setsockopt (zocket, ZMQ_XPUB_VERBOSE, &xpub_verbose, sizeof (int));
960
1149
  assert (rc == 0 || zmq_errno () == ETERM);
1150
+ # endif
961
1151
  }
962
1152
 
963
1153
 
@@ -968,8 +1158,10 @@ zsocket_set_xpub_verbose (void *zocket, int xpub_verbose)
968
1158
  void
969
1159
  zsocket_set_tcp_keepalive (void *zocket, int tcp_keepalive)
970
1160
  {
1161
+ # if defined (ZMQ_TCP_KEEPALIVE)
971
1162
  int rc = zmq_setsockopt (zocket, ZMQ_TCP_KEEPALIVE, &tcp_keepalive, sizeof (int));
972
1163
  assert (rc == 0 || zmq_errno () == ETERM);
1164
+ # endif
973
1165
  }
974
1166
 
975
1167
 
@@ -980,10 +1172,14 @@ zsocket_set_tcp_keepalive (void *zocket, int tcp_keepalive)
980
1172
  int
981
1173
  zsocket_tcp_keepalive (void *zocket)
982
1174
  {
1175
+ # if defined (ZMQ_TCP_KEEPALIVE)
983
1176
  int tcp_keepalive;
984
1177
  size_t option_len = sizeof (int);
985
1178
  zmq_getsockopt (zocket, ZMQ_TCP_KEEPALIVE, &tcp_keepalive, &option_len);
986
1179
  return tcp_keepalive;
1180
+ # else
1181
+ return 0;
1182
+ # endif
987
1183
  }
988
1184
 
989
1185
 
@@ -994,8 +1190,10 @@ zsocket_tcp_keepalive (void *zocket)
994
1190
  void
995
1191
  zsocket_set_tcp_keepalive_idle (void *zocket, int tcp_keepalive_idle)
996
1192
  {
1193
+ # if defined (ZMQ_TCP_KEEPALIVE_IDLE)
997
1194
  int rc = zmq_setsockopt (zocket, ZMQ_TCP_KEEPALIVE_IDLE, &tcp_keepalive_idle, sizeof (int));
998
1195
  assert (rc == 0 || zmq_errno () == ETERM);
1196
+ # endif
999
1197
  }
1000
1198
 
1001
1199
 
@@ -1006,10 +1204,14 @@ zsocket_set_tcp_keepalive_idle (void *zocket, int tcp_keepalive_idle)
1006
1204
  int
1007
1205
  zsocket_tcp_keepalive_idle (void *zocket)
1008
1206
  {
1207
+ # if defined (ZMQ_TCP_KEEPALIVE_IDLE)
1009
1208
  int tcp_keepalive_idle;
1010
1209
  size_t option_len = sizeof (int);
1011
1210
  zmq_getsockopt (zocket, ZMQ_TCP_KEEPALIVE_IDLE, &tcp_keepalive_idle, &option_len);
1012
1211
  return tcp_keepalive_idle;
1212
+ # else
1213
+ return 0;
1214
+ # endif
1013
1215
  }
1014
1216
 
1015
1217
 
@@ -1020,8 +1222,10 @@ zsocket_tcp_keepalive_idle (void *zocket)
1020
1222
  void
1021
1223
  zsocket_set_tcp_keepalive_cnt (void *zocket, int tcp_keepalive_cnt)
1022
1224
  {
1225
+ # if defined (ZMQ_TCP_KEEPALIVE_CNT)
1023
1226
  int rc = zmq_setsockopt (zocket, ZMQ_TCP_KEEPALIVE_CNT, &tcp_keepalive_cnt, sizeof (int));
1024
1227
  assert (rc == 0 || zmq_errno () == ETERM);
1228
+ # endif
1025
1229
  }
1026
1230
 
1027
1231
 
@@ -1032,10 +1236,14 @@ zsocket_set_tcp_keepalive_cnt (void *zocket, int tcp_keepalive_cnt)
1032
1236
  int
1033
1237
  zsocket_tcp_keepalive_cnt (void *zocket)
1034
1238
  {
1239
+ # if defined (ZMQ_TCP_KEEPALIVE_CNT)
1035
1240
  int tcp_keepalive_cnt;
1036
1241
  size_t option_len = sizeof (int);
1037
1242
  zmq_getsockopt (zocket, ZMQ_TCP_KEEPALIVE_CNT, &tcp_keepalive_cnt, &option_len);
1038
1243
  return tcp_keepalive_cnt;
1244
+ # else
1245
+ return 0;
1246
+ # endif
1039
1247
  }
1040
1248
 
1041
1249
 
@@ -1046,8 +1254,10 @@ zsocket_tcp_keepalive_cnt (void *zocket)
1046
1254
  void
1047
1255
  zsocket_set_tcp_keepalive_intvl (void *zocket, int tcp_keepalive_intvl)
1048
1256
  {
1257
+ # if defined (ZMQ_TCP_KEEPALIVE_INTVL)
1049
1258
  int rc = zmq_setsockopt (zocket, ZMQ_TCP_KEEPALIVE_INTVL, &tcp_keepalive_intvl, sizeof (int));
1050
1259
  assert (rc == 0 || zmq_errno () == ETERM);
1260
+ # endif
1051
1261
  }
1052
1262
 
1053
1263
 
@@ -1058,10 +1268,14 @@ zsocket_set_tcp_keepalive_intvl (void *zocket, int tcp_keepalive_intvl)
1058
1268
  int
1059
1269
  zsocket_tcp_keepalive_intvl (void *zocket)
1060
1270
  {
1271
+ # if defined (ZMQ_TCP_KEEPALIVE_INTVL)
1061
1272
  int tcp_keepalive_intvl;
1062
1273
  size_t option_len = sizeof (int);
1063
1274
  zmq_getsockopt (zocket, ZMQ_TCP_KEEPALIVE_INTVL, &tcp_keepalive_intvl, &option_len);
1064
1275
  return tcp_keepalive_intvl;
1276
+ # else
1277
+ return 0;
1278
+ # endif
1065
1279
  }
1066
1280
 
1067
1281
 
@@ -1072,8 +1286,10 @@ zsocket_tcp_keepalive_intvl (void *zocket)
1072
1286
  void
1073
1287
  zsocket_set_tcp_accept_filter (void *zocket, const char * tcp_accept_filter)
1074
1288
  {
1289
+ # if defined (ZMQ_TCP_ACCEPT_FILTER)
1075
1290
  int rc = zmq_setsockopt (zocket, ZMQ_TCP_ACCEPT_FILTER, tcp_accept_filter, strlen (tcp_accept_filter));
1076
1291
  assert (rc == 0 || zmq_errno () == ETERM);
1292
+ # endif
1077
1293
  }
1078
1294
 
1079
1295
 
@@ -1084,10 +1300,14 @@ zsocket_set_tcp_accept_filter (void *zocket, const char * tcp_accept_filter)
1084
1300
  char *
1085
1301
  zsocket_tcp_accept_filter (void *zocket)
1086
1302
  {
1303
+ # if defined (ZMQ_TCP_ACCEPT_FILTER)
1087
1304
  size_t option_len = 255;
1088
1305
  char *tcp_accept_filter = (char *) zmalloc (option_len);
1089
1306
  zmq_getsockopt (zocket, ZMQ_TCP_ACCEPT_FILTER, tcp_accept_filter, &option_len);
1090
1307
  return (char *) tcp_accept_filter;
1308
+ # else
1309
+ return NULL;
1310
+ # endif
1091
1311
  }
1092
1312
 
1093
1313
 
@@ -1098,10 +1318,14 @@ zsocket_tcp_accept_filter (void *zocket)
1098
1318
  int
1099
1319
  zsocket_rcvmore (void *zocket)
1100
1320
  {
1321
+ # if defined (ZMQ_RCVMORE)
1101
1322
  int rcvmore;
1102
1323
  size_t option_len = sizeof (int);
1103
1324
  zmq_getsockopt (zocket, ZMQ_RCVMORE, &rcvmore, &option_len);
1104
1325
  return rcvmore;
1326
+ # else
1327
+ return 0;
1328
+ # endif
1105
1329
  }
1106
1330
 
1107
1331
 
@@ -1112,10 +1336,14 @@ zsocket_rcvmore (void *zocket)
1112
1336
  int
1113
1337
  zsocket_fd (void *zocket)
1114
1338
  {
1339
+ # if defined (ZMQ_FD)
1115
1340
  int fd;
1116
1341
  size_t option_len = sizeof (int);
1117
1342
  zmq_getsockopt (zocket, ZMQ_FD, &fd, &option_len);
1118
1343
  return fd;
1344
+ # else
1345
+ return 0;
1346
+ # endif
1119
1347
  }
1120
1348
 
1121
1349
 
@@ -1126,10 +1354,14 @@ zsocket_fd (void *zocket)
1126
1354
  int
1127
1355
  zsocket_events (void *zocket)
1128
1356
  {
1357
+ # if defined (ZMQ_EVENTS)
1129
1358
  int events;
1130
1359
  size_t option_len = sizeof (int);
1131
1360
  zmq_getsockopt (zocket, ZMQ_EVENTS, &events, &option_len);
1132
1361
  return events;
1362
+ # else
1363
+ return 0;
1364
+ # endif
1133
1365
  }
1134
1366
 
1135
1367
 
@@ -1140,10 +1372,14 @@ zsocket_events (void *zocket)
1140
1372
  char *
1141
1373
  zsocket_last_endpoint (void *zocket)
1142
1374
  {
1375
+ # if defined (ZMQ_LAST_ENDPOINT)
1143
1376
  size_t option_len = 255;
1144
1377
  char *last_endpoint = (char *) zmalloc (option_len);
1145
1378
  zmq_getsockopt (zocket, ZMQ_LAST_ENDPOINT, last_endpoint, &option_len);
1146
1379
  return (char *) last_endpoint;
1380
+ # else
1381
+ return NULL;
1382
+ # endif
1147
1383
  }
1148
1384
 
1149
1385
 
@@ -2712,56 +2948,79 @@ zsockopt_test (bool verbose)
2712
2948
  assert (ctx);
2713
2949
  void *zocket;
2714
2950
  #if (ZMQ_VERSION_MAJOR == 4)
2951
+ # if defined (ZMQ_IPV6)
2715
2952
  zocket = zsocket_new (ctx, ZMQ_SUB);
2716
2953
  assert (zocket);
2717
2954
  zsocket_set_ipv6 (zocket, 1);
2718
2955
  assert (zsocket_ipv6 (zocket) == 1);
2719
2956
  zsocket_ipv6 (zocket);
2720
2957
  zsocket_destroy (ctx, zocket);
2958
+ # endif
2959
+ # if defined (ZMQ_IMMEDIATE)
2721
2960
  zocket = zsocket_new (ctx, ZMQ_DEALER);
2722
2961
  assert (zocket);
2723
2962
  zsocket_set_immediate (zocket, 1);
2724
2963
  zsocket_destroy (ctx, zocket);
2964
+ # endif
2965
+ # if defined (ZMQ_ROUTER_RAW)
2725
2966
  zocket = zsocket_new (ctx, ZMQ_ROUTER);
2726
2967
  assert (zocket);
2727
2968
  zsocket_set_router_raw (zocket, 1);
2728
2969
  zsocket_destroy (ctx, zocket);
2970
+ # endif
2971
+ # if defined (ZMQ_IPV4ONLY)
2729
2972
  zocket = zsocket_new (ctx, ZMQ_SUB);
2730
2973
  assert (zocket);
2731
2974
  zsocket_set_ipv4only (zocket, 1);
2732
2975
  assert (zsocket_ipv4only (zocket) == 1);
2733
2976
  zsocket_ipv4only (zocket);
2734
2977
  zsocket_destroy (ctx, zocket);
2978
+ # endif
2979
+ # if defined (ZMQ_DELAY_ATTACH_ON_CONNECT)
2735
2980
  zocket = zsocket_new (ctx, ZMQ_PUB);
2736
2981
  assert (zocket);
2737
2982
  zsocket_set_delay_attach_on_connect (zocket, 1);
2738
2983
  zsocket_destroy (ctx, zocket);
2984
+ # endif
2985
+ # if defined (ZMQ_ROUTER_MANDATORY)
2739
2986
  zocket = zsocket_new (ctx, ZMQ_ROUTER);
2740
2987
  assert (zocket);
2741
2988
  zsocket_set_router_mandatory (zocket, 1);
2742
2989
  zsocket_destroy (ctx, zocket);
2990
+ # endif
2991
+ # if defined (ZMQ_PROBE_ROUTER)
2743
2992
  zocket = zsocket_new (ctx, ZMQ_DEALER);
2744
2993
  assert (zocket);
2745
2994
  zsocket_probe_router (zocket);
2746
2995
  zsocket_destroy (ctx, zocket);
2996
+ # endif
2997
+ # if defined (ZMQ_REQ_RELAXED)
2747
2998
  zocket = zsocket_new (ctx, ZMQ_REQ);
2748
2999
  assert (zocket);
2749
3000
  zsocket_set_req_relaxed (zocket, 1);
2750
3001
  zsocket_destroy (ctx, zocket);
3002
+ # endif
3003
+ # if defined (ZMQ_REQ_CORRELATE)
2751
3004
  zocket = zsocket_new (ctx, ZMQ_REQ);
2752
3005
  assert (zocket);
2753
3006
  zsocket_set_req_correlate (zocket, 1);
2754
3007
  zsocket_destroy (ctx, zocket);
3008
+ # endif
3009
+ # if defined (ZMQ_CONFLATE)
2755
3010
  zocket = zsocket_new (ctx, ZMQ_PUSH);
2756
3011
  assert (zocket);
2757
3012
  zsocket_set_conflate (zocket, 1);
2758
3013
  zsocket_destroy (ctx, zocket);
3014
+ # endif
3015
+ # if defined (ZMQ_PLAIN_SERVER)
2759
3016
  zocket = zsocket_new (ctx, ZMQ_PUB);
2760
3017
  assert (zocket);
2761
3018
  zsocket_set_plain_server (zocket, 1);
2762
3019
  assert (zsocket_plain_server (zocket) == 1);
2763
3020
  zsocket_plain_server (zocket);
2764
3021
  zsocket_destroy (ctx, zocket);
3022
+ # endif
3023
+ # if defined (ZMQ_PLAIN_USERNAME)
2765
3024
  zocket = zsocket_new (ctx, ZMQ_SUB);
2766
3025
  assert (zocket);
2767
3026
  zsocket_set_plain_username (zocket, "test");
@@ -2769,6 +3028,8 @@ zsockopt_test (bool verbose)
2769
3028
  assert (plain_username);
2770
3029
  free (plain_username);
2771
3030
  zsocket_destroy (ctx, zocket);
3031
+ # endif
3032
+ # if defined (ZMQ_PLAIN_PASSWORD)
2772
3033
  zocket = zsocket_new (ctx, ZMQ_SUB);
2773
3034
  assert (zocket);
2774
3035
  zsocket_set_plain_password (zocket, "test");
@@ -2776,6 +3037,8 @@ zsockopt_test (bool verbose)
2776
3037
  assert (plain_password);
2777
3038
  free (plain_password);
2778
3039
  zsocket_destroy (ctx, zocket);
3040
+ # endif
3041
+ # if defined (ZMQ_CURVE_SERVER)
2779
3042
  # if defined (HAVE_LIBSODIUM)
2780
3043
  zocket = zsocket_new (ctx, ZMQ_PUB);
2781
3044
  assert (zocket);
@@ -2784,6 +3047,8 @@ zsockopt_test (bool verbose)
2784
3047
  zsocket_curve_server (zocket);
2785
3048
  zsocket_destroy (ctx, zocket);
2786
3049
  # endif
3050
+ # endif
3051
+ # if defined (ZMQ_CURVE_PUBLICKEY)
2787
3052
  # if defined (HAVE_LIBSODIUM)
2788
3053
  zocket = zsocket_new (ctx, ZMQ_PUB);
2789
3054
  assert (zocket);
@@ -2793,6 +3058,8 @@ zsockopt_test (bool verbose)
2793
3058
  free (curve_publickey);
2794
3059
  zsocket_destroy (ctx, zocket);
2795
3060
  # endif
3061
+ # endif
3062
+ # if defined (ZMQ_CURVE_SECRETKEY)
2796
3063
  # if defined (HAVE_LIBSODIUM)
2797
3064
  zocket = zsocket_new (ctx, ZMQ_PUB);
2798
3065
  assert (zocket);
@@ -2802,6 +3069,8 @@ zsockopt_test (bool verbose)
2802
3069
  free (curve_secretkey);
2803
3070
  zsocket_destroy (ctx, zocket);
2804
3071
  # endif
3072
+ # endif
3073
+ # if defined (ZMQ_CURVE_SERVERKEY)
2805
3074
  # if defined (HAVE_LIBSODIUM)
2806
3075
  zocket = zsocket_new (ctx, ZMQ_SUB);
2807
3076
  assert (zocket);
@@ -2811,6 +3080,8 @@ zsockopt_test (bool verbose)
2811
3080
  free (curve_serverkey);
2812
3081
  zsocket_destroy (ctx, zocket);
2813
3082
  # endif
3083
+ # endif
3084
+ # if defined (ZMQ_ZAP_DOMAIN)
2814
3085
  zocket = zsocket_new (ctx, ZMQ_SUB);
2815
3086
  assert (zocket);
2816
3087
  zsocket_set_zap_domain (zocket, "test");
@@ -2818,36 +3089,50 @@ zsockopt_test (bool verbose)
2818
3089
  assert (zap_domain);
2819
3090
  free (zap_domain);
2820
3091
  zsocket_destroy (ctx, zocket);
3092
+ # endif
3093
+ # if defined (ZMQ_TYPE)
2821
3094
  zocket = zsocket_new (ctx, ZMQ_SUB);
2822
3095
  assert (zocket);
2823
3096
  zsocket_type (zocket);
2824
3097
  zsocket_destroy (ctx, zocket);
3098
+ # endif
3099
+ # if defined (ZMQ_SNDHWM)
2825
3100
  zocket = zsocket_new (ctx, ZMQ_PUB);
2826
3101
  assert (zocket);
2827
3102
  zsocket_set_sndhwm (zocket, 1);
2828
3103
  assert (zsocket_sndhwm (zocket) == 1);
2829
3104
  zsocket_sndhwm (zocket);
2830
3105
  zsocket_destroy (ctx, zocket);
3106
+ # endif
3107
+ # if defined (ZMQ_RCVHWM)
2831
3108
  zocket = zsocket_new (ctx, ZMQ_SUB);
2832
3109
  assert (zocket);
2833
3110
  zsocket_set_rcvhwm (zocket, 1);
2834
3111
  assert (zsocket_rcvhwm (zocket) == 1);
2835
3112
  zsocket_rcvhwm (zocket);
2836
3113
  zsocket_destroy (ctx, zocket);
3114
+ # endif
3115
+ # if defined (ZMQ_AFFINITY)
2837
3116
  zocket = zsocket_new (ctx, ZMQ_SUB);
2838
3117
  assert (zocket);
2839
3118
  zsocket_set_affinity (zocket, 1);
2840
3119
  assert (zsocket_affinity (zocket) == 1);
2841
3120
  zsocket_affinity (zocket);
2842
3121
  zsocket_destroy (ctx, zocket);
3122
+ # endif
3123
+ # if defined (ZMQ_SUBSCRIBE)
2843
3124
  zocket = zsocket_new (ctx, ZMQ_SUB);
2844
3125
  assert (zocket);
2845
3126
  zsocket_set_subscribe (zocket, "test");
2846
3127
  zsocket_destroy (ctx, zocket);
3128
+ # endif
3129
+ # if defined (ZMQ_UNSUBSCRIBE)
2847
3130
  zocket = zsocket_new (ctx, ZMQ_SUB);
2848
3131
  assert (zocket);
2849
3132
  zsocket_set_unsubscribe (zocket, "test");
2850
3133
  zsocket_destroy (ctx, zocket);
3134
+ # endif
3135
+ # if defined (ZMQ_IDENTITY)
2851
3136
  zocket = zsocket_new (ctx, ZMQ_DEALER);
2852
3137
  assert (zocket);
2853
3138
  zsocket_set_identity (zocket, "test");
@@ -2855,106 +3140,142 @@ zsockopt_test (bool verbose)
2855
3140
  assert (identity);
2856
3141
  free (identity);
2857
3142
  zsocket_destroy (ctx, zocket);
3143
+ # endif
3144
+ # if defined (ZMQ_RATE)
2858
3145
  zocket = zsocket_new (ctx, ZMQ_SUB);
2859
3146
  assert (zocket);
2860
3147
  zsocket_set_rate (zocket, 1);
2861
3148
  assert (zsocket_rate (zocket) == 1);
2862
3149
  zsocket_rate (zocket);
2863
3150
  zsocket_destroy (ctx, zocket);
3151
+ # endif
3152
+ # if defined (ZMQ_RECOVERY_IVL)
2864
3153
  zocket = zsocket_new (ctx, ZMQ_SUB);
2865
3154
  assert (zocket);
2866
3155
  zsocket_set_recovery_ivl (zocket, 1);
2867
3156
  assert (zsocket_recovery_ivl (zocket) == 1);
2868
3157
  zsocket_recovery_ivl (zocket);
2869
3158
  zsocket_destroy (ctx, zocket);
3159
+ # endif
3160
+ # if defined (ZMQ_SNDBUF)
2870
3161
  zocket = zsocket_new (ctx, ZMQ_PUB);
2871
3162
  assert (zocket);
2872
3163
  zsocket_set_sndbuf (zocket, 1);
2873
3164
  assert (zsocket_sndbuf (zocket) == 1);
2874
3165
  zsocket_sndbuf (zocket);
2875
3166
  zsocket_destroy (ctx, zocket);
3167
+ # endif
3168
+ # if defined (ZMQ_RCVBUF)
2876
3169
  zocket = zsocket_new (ctx, ZMQ_SUB);
2877
3170
  assert (zocket);
2878
3171
  zsocket_set_rcvbuf (zocket, 1);
2879
3172
  assert (zsocket_rcvbuf (zocket) == 1);
2880
3173
  zsocket_rcvbuf (zocket);
2881
3174
  zsocket_destroy (ctx, zocket);
3175
+ # endif
3176
+ # if defined (ZMQ_LINGER)
2882
3177
  zocket = zsocket_new (ctx, ZMQ_SUB);
2883
3178
  assert (zocket);
2884
3179
  zsocket_set_linger (zocket, 1);
2885
3180
  assert (zsocket_linger (zocket) == 1);
2886
3181
  zsocket_linger (zocket);
2887
3182
  zsocket_destroy (ctx, zocket);
3183
+ # endif
3184
+ # if defined (ZMQ_RECONNECT_IVL)
2888
3185
  zocket = zsocket_new (ctx, ZMQ_SUB);
2889
3186
  assert (zocket);
2890
3187
  zsocket_set_reconnect_ivl (zocket, 1);
2891
3188
  assert (zsocket_reconnect_ivl (zocket) == 1);
2892
3189
  zsocket_reconnect_ivl (zocket);
2893
3190
  zsocket_destroy (ctx, zocket);
3191
+ # endif
3192
+ # if defined (ZMQ_RECONNECT_IVL_MAX)
2894
3193
  zocket = zsocket_new (ctx, ZMQ_SUB);
2895
3194
  assert (zocket);
2896
3195
  zsocket_set_reconnect_ivl_max (zocket, 1);
2897
3196
  assert (zsocket_reconnect_ivl_max (zocket) == 1);
2898
3197
  zsocket_reconnect_ivl_max (zocket);
2899
3198
  zsocket_destroy (ctx, zocket);
3199
+ # endif
3200
+ # if defined (ZMQ_BACKLOG)
2900
3201
  zocket = zsocket_new (ctx, ZMQ_SUB);
2901
3202
  assert (zocket);
2902
3203
  zsocket_set_backlog (zocket, 1);
2903
3204
  assert (zsocket_backlog (zocket) == 1);
2904
3205
  zsocket_backlog (zocket);
2905
3206
  zsocket_destroy (ctx, zocket);
3207
+ # endif
3208
+ # if defined (ZMQ_MAXMSGSIZE)
2906
3209
  zocket = zsocket_new (ctx, ZMQ_SUB);
2907
3210
  assert (zocket);
2908
3211
  zsocket_set_maxmsgsize (zocket, 1);
2909
3212
  assert (zsocket_maxmsgsize (zocket) == 1);
2910
3213
  zsocket_maxmsgsize (zocket);
2911
3214
  zsocket_destroy (ctx, zocket);
3215
+ # endif
3216
+ # if defined (ZMQ_MULTICAST_HOPS)
2912
3217
  zocket = zsocket_new (ctx, ZMQ_SUB);
2913
3218
  assert (zocket);
2914
3219
  zsocket_set_multicast_hops (zocket, 1);
2915
3220
  assert (zsocket_multicast_hops (zocket) == 1);
2916
3221
  zsocket_multicast_hops (zocket);
2917
3222
  zsocket_destroy (ctx, zocket);
3223
+ # endif
3224
+ # if defined (ZMQ_RCVTIMEO)
2918
3225
  zocket = zsocket_new (ctx, ZMQ_SUB);
2919
3226
  assert (zocket);
2920
3227
  zsocket_set_rcvtimeo (zocket, 1);
2921
3228
  assert (zsocket_rcvtimeo (zocket) == 1);
2922
3229
  zsocket_rcvtimeo (zocket);
2923
3230
  zsocket_destroy (ctx, zocket);
3231
+ # endif
3232
+ # if defined (ZMQ_SNDTIMEO)
2924
3233
  zocket = zsocket_new (ctx, ZMQ_SUB);
2925
3234
  assert (zocket);
2926
3235
  zsocket_set_sndtimeo (zocket, 1);
2927
3236
  assert (zsocket_sndtimeo (zocket) == 1);
2928
3237
  zsocket_sndtimeo (zocket);
2929
3238
  zsocket_destroy (ctx, zocket);
3239
+ # endif
3240
+ # if defined (ZMQ_XPUB_VERBOSE)
2930
3241
  zocket = zsocket_new (ctx, ZMQ_XPUB);
2931
3242
  assert (zocket);
2932
3243
  zsocket_set_xpub_verbose (zocket, 1);
2933
3244
  zsocket_destroy (ctx, zocket);
3245
+ # endif
3246
+ # if defined (ZMQ_TCP_KEEPALIVE)
2934
3247
  zocket = zsocket_new (ctx, ZMQ_SUB);
2935
3248
  assert (zocket);
2936
3249
  zsocket_set_tcp_keepalive (zocket, 1);
2937
3250
  assert (zsocket_tcp_keepalive (zocket) == 1);
2938
3251
  zsocket_tcp_keepalive (zocket);
2939
3252
  zsocket_destroy (ctx, zocket);
3253
+ # endif
3254
+ # if defined (ZMQ_TCP_KEEPALIVE_IDLE)
2940
3255
  zocket = zsocket_new (ctx, ZMQ_SUB);
2941
3256
  assert (zocket);
2942
3257
  zsocket_set_tcp_keepalive_idle (zocket, 1);
2943
3258
  assert (zsocket_tcp_keepalive_idle (zocket) == 1);
2944
3259
  zsocket_tcp_keepalive_idle (zocket);
2945
3260
  zsocket_destroy (ctx, zocket);
3261
+ # endif
3262
+ # if defined (ZMQ_TCP_KEEPALIVE_CNT)
2946
3263
  zocket = zsocket_new (ctx, ZMQ_SUB);
2947
3264
  assert (zocket);
2948
3265
  zsocket_set_tcp_keepalive_cnt (zocket, 1);
2949
3266
  assert (zsocket_tcp_keepalive_cnt (zocket) == 1);
2950
3267
  zsocket_tcp_keepalive_cnt (zocket);
2951
3268
  zsocket_destroy (ctx, zocket);
3269
+ # endif
3270
+ # if defined (ZMQ_TCP_KEEPALIVE_INTVL)
2952
3271
  zocket = zsocket_new (ctx, ZMQ_SUB);
2953
3272
  assert (zocket);
2954
3273
  zsocket_set_tcp_keepalive_intvl (zocket, 1);
2955
3274
  assert (zsocket_tcp_keepalive_intvl (zocket) == 1);
2956
3275
  zsocket_tcp_keepalive_intvl (zocket);
2957
3276
  zsocket_destroy (ctx, zocket);
3277
+ # endif
3278
+ # if defined (ZMQ_TCP_ACCEPT_FILTER)
2958
3279
  zocket = zsocket_new (ctx, ZMQ_SUB);
2959
3280
  assert (zocket);
2960
3281
  zsocket_set_tcp_accept_filter (zocket, "127.0.0.1");
@@ -2962,24 +3283,33 @@ zsockopt_test (bool verbose)
2962
3283
  assert (tcp_accept_filter);
2963
3284
  free (tcp_accept_filter);
2964
3285
  zsocket_destroy (ctx, zocket);
3286
+ # endif
3287
+ # if defined (ZMQ_RCVMORE)
2965
3288
  zocket = zsocket_new (ctx, ZMQ_SUB);
2966
3289
  assert (zocket);
2967
3290
  zsocket_rcvmore (zocket);
2968
3291
  zsocket_destroy (ctx, zocket);
3292
+ # endif
3293
+ # if defined (ZMQ_FD)
2969
3294
  zocket = zsocket_new (ctx, ZMQ_SUB);
2970
3295
  assert (zocket);
2971
3296
  zsocket_fd (zocket);
2972
3297
  zsocket_destroy (ctx, zocket);
3298
+ # endif
3299
+ # if defined (ZMQ_EVENTS)
2973
3300
  zocket = zsocket_new (ctx, ZMQ_SUB);
2974
3301
  assert (zocket);
2975
3302
  zsocket_events (zocket);
2976
3303
  zsocket_destroy (ctx, zocket);
3304
+ # endif
3305
+ # if defined (ZMQ_LAST_ENDPOINT)
2977
3306
  zocket = zsocket_new (ctx, ZMQ_SUB);
2978
3307
  assert (zocket);
2979
3308
  char *last_endpoint = zsocket_last_endpoint (zocket);
2980
3309
  assert (last_endpoint);
2981
3310
  free (last_endpoint);
2982
3311
  zsocket_destroy (ctx, zocket);
3312
+ # endif
2983
3313
 
2984
3314
  zocket = zsocket_new (ctx, ZMQ_SUB);
2985
3315
  zsocket_set_hwm (zocket, 1);