czmq-ffi-gen 0.15.0 → 0.16.0

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.
@@ -0,0 +1,161 @@
1
+ ################################################################################
2
+ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
3
+ # Read the zproject/README.md for information about making permanent changes. #
4
+ ################################################################################
5
+
6
+ module CZMQ
7
+ module FFI
8
+
9
+ # zhttp server.
10
+ # @note This class is 100% generated using zproject.
11
+ class ZhttpServerOptions
12
+ # Raised when one tries to use an instance of {ZhttpServerOptions} after
13
+ # the internal pointer to the native object has been nullified.
14
+ class DestroyedError < RuntimeError; end
15
+
16
+ # Boilerplate for self pointer, initializer, and finalizer
17
+ class << self
18
+ alias :__new :new
19
+ end
20
+ # Attaches the pointer _ptr_ to this instance and defines a finalizer for
21
+ # it if necessary.
22
+ # @param ptr [::FFI::Pointer]
23
+ # @param finalize [Boolean]
24
+ def initialize(ptr, finalize = true)
25
+ @ptr = ptr
26
+ if @ptr.null?
27
+ @ptr = nil # Remove null pointers so we don't have to test for them.
28
+ elsif finalize
29
+ @finalizer = self.class.create_finalizer_for @ptr
30
+ ObjectSpace.define_finalizer self, @finalizer
31
+ end
32
+ end
33
+ # @param ptr [::FFI::Pointer]
34
+ # @return [Proc]
35
+ def self.create_finalizer_for(ptr)
36
+ Proc.new do
37
+ ptr_ptr = ::FFI::MemoryPointer.new :pointer
38
+ ptr_ptr.write_pointer ptr
39
+ ::CZMQ::FFI.zhttp_server_options_destroy ptr_ptr
40
+ end
41
+ end
42
+ # @return [Boolean]
43
+ def null?
44
+ !@ptr or @ptr.null?
45
+ end
46
+ # Return internal pointer
47
+ # @return [::FFI::Pointer]
48
+ def __ptr
49
+ raise DestroyedError unless @ptr
50
+ @ptr
51
+ end
52
+ # So external Libraries can just pass the Object to a FFI function which expects a :pointer
53
+ alias_method :to_ptr, :__ptr
54
+ # Nullify internal pointer and return pointer pointer.
55
+ # @note This detaches the current instance from the native object
56
+ # and thus makes it unusable.
57
+ # @return [::FFI::MemoryPointer] the pointer pointing to a pointer
58
+ # pointing to the native object
59
+ def __ptr_give_ref
60
+ raise DestroyedError unless @ptr
61
+ ptr_ptr = ::FFI::MemoryPointer.new :pointer
62
+ ptr_ptr.write_pointer @ptr
63
+ __undef_finalizer if @finalizer
64
+ @ptr = nil
65
+ ptr_ptr
66
+ end
67
+ # Undefines the finalizer for this object.
68
+ # @note Only use this if you need to and can guarantee that the native
69
+ # object will be freed by other means.
70
+ # @return [void]
71
+ def __undef_finalizer
72
+ ObjectSpace.undefine_finalizer self
73
+ @finalizer = nil
74
+ end
75
+
76
+ # Create a new zhttp_server_options.
77
+ # @return [CZMQ::ZhttpServerOptions]
78
+ def self.new()
79
+ ptr = ::CZMQ::FFI.zhttp_server_options_new()
80
+ __new ptr
81
+ end
82
+
83
+ # Create options from config tree.
84
+ # @param config [Zconfig, #__ptr]
85
+ # @return [CZMQ::ZhttpServerOptions]
86
+ def self.from_config(config)
87
+ config = config.__ptr if config
88
+ ptr = ::CZMQ::FFI.zhttp_server_options_from_config(config)
89
+ __new ptr
90
+ end
91
+
92
+ # Destroy the zhttp_server_options.
93
+ #
94
+ # @return [void]
95
+ def destroy()
96
+ return unless @ptr
97
+ self_p = __ptr_give_ref
98
+ result = ::CZMQ::FFI.zhttp_server_options_destroy(self_p)
99
+ result
100
+ end
101
+
102
+ # Get the server listening port.
103
+ #
104
+ # @return [Integer]
105
+ def port()
106
+ raise DestroyedError unless @ptr
107
+ self_p = @ptr
108
+ result = ::CZMQ::FFI.zhttp_server_options_port(self_p)
109
+ result
110
+ end
111
+
112
+ # Set the server listening port
113
+ #
114
+ # @param port [Integer, #to_int, #to_i]
115
+ # @return [void]
116
+ def set_port(port)
117
+ raise DestroyedError unless @ptr
118
+ self_p = @ptr
119
+ port = Integer(port)
120
+ result = ::CZMQ::FFI.zhttp_server_options_set_port(self_p, port)
121
+ result
122
+ end
123
+
124
+ # Get the address sockets should connect to in order to receive requests.
125
+ #
126
+ # @return [String]
127
+ def backend_address()
128
+ raise DestroyedError unless @ptr
129
+ self_p = @ptr
130
+ result = ::CZMQ::FFI.zhttp_server_options_backend_address(self_p)
131
+ result
132
+ end
133
+
134
+ # Set the address sockets should connect to in order to receive requests.
135
+ #
136
+ # @param address [String, #to_s, nil]
137
+ # @return [void]
138
+ def set_backend_address(address)
139
+ raise DestroyedError unless @ptr
140
+ self_p = @ptr
141
+ result = ::CZMQ::FFI.zhttp_server_options_set_backend_address(self_p, address)
142
+ result
143
+ end
144
+
145
+ # Self test of this class.
146
+ #
147
+ # @param verbose [Boolean]
148
+ # @return [void]
149
+ def self.test(verbose)
150
+ verbose = !(0==verbose||!verbose) # boolean
151
+ result = ::CZMQ::FFI.zhttp_server_options_test(verbose)
152
+ result
153
+ end
154
+ end
155
+ end
156
+ end
157
+
158
+ ################################################################################
159
+ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
160
+ # Read the zproject/README.md for information about making permanent changes. #
161
+ ################################################################################
@@ -129,6 +129,17 @@ module CZMQ
129
129
  __new ptr
130
130
  end
131
131
 
132
+ # Unpack binary frame into a new list. Packed data must follow format
133
+ # defined by zlistx_pack. List is set to autofree. An empty frame
134
+ # unpacks to an empty list.
135
+ # @param frame [Zframe, #__ptr]
136
+ # @return [CZMQ::Zlistx]
137
+ def self.unpack(frame)
138
+ frame = frame.__ptr if frame
139
+ ptr = ::CZMQ::FFI.zlistx_unpack(frame)
140
+ __new ptr
141
+ end
142
+
132
143
  # Destroy a list. If an item destructor was specified, all items in the
133
144
  # list are automatically destroyed as well.
134
145
  #
@@ -315,7 +326,7 @@ module CZMQ
315
326
  result
316
327
  end
317
328
 
318
- # Delete an item, using its handle. Calls the item destructor is any is
329
+ # Delete an item, using its handle. Calls the item destructor if any is
319
330
  # set. If handle is null, deletes the first item on the list. Returns 0
320
331
  # if an item was deleted, -1 if not. If cursor was at item, moves cursor
321
332
  # to previous item, so you can delete items while iterating forwards
@@ -459,6 +470,28 @@ module CZMQ
459
470
  result
460
471
  end
461
472
 
473
+ # Serialize list to a binary frame that can be sent in a message.
474
+ # The packed format is compatible with the 'strings' type implemented by zproto:
475
+ #
476
+ # ; A list of strings
477
+ # list = list-count *longstr
478
+ # list-count = number-4
479
+ #
480
+ # ; Strings are always length + text contents
481
+ # longstr = number-4 *VCHAR
482
+ #
483
+ # ; Numbers are unsigned integers in network byte order
484
+ # number-4 = 4OCTET
485
+ #
486
+ # @return [Zframe]
487
+ def pack()
488
+ raise DestroyedError unless @ptr
489
+ self_p = @ptr
490
+ result = ::CZMQ::FFI.zlistx_pack(self_p)
491
+ result = Zframe.__new result, true
492
+ result
493
+ end
494
+
462
495
  # Self test of this class.
463
496
  #
464
497
  # @param verbose [Boolean]
@@ -95,7 +95,8 @@ module CZMQ
95
95
  end
96
96
 
97
97
  # Add a reader to be polled. Returns 0 if OK, -1 on failure. The reader may
98
- # be a libzmq void * socket, a zsock_t instance, or a zactor_t instance.
98
+ # be a libzmq void * socket, a zsock_t instance, a zactor_t instance or a
99
+ # file handle.
99
100
  #
100
101
  # @param reader [::FFI::Pointer, #to_ptr]
101
102
  # @return [Integer]
@@ -134,14 +135,15 @@ module CZMQ
134
135
  end
135
136
 
136
137
  # Poll the registered readers for I/O, return first reader that has input.
137
- # The reader will be a libzmq void * socket, or a zsock_t or zactor_t
138
- # instance as specified in zpoller_new/zpoller_add. The timeout should be
139
- # zero or greater, or -1 to wait indefinitely. Socket priority is defined
140
- # by their order in the poll list. If you need a balanced poll, use the low
141
- # level zmq_poll method directly. If the poll call was interrupted (SIGINT),
142
- # or the ZMQ context was destroyed, or the timeout expired, returns NULL.
143
- # You can test the actual exit condition by calling zpoller_expired () and
144
- # zpoller_terminated (). The timeout is in msec.
138
+ # The reader will be a libzmq void * socket, a zsock_t, a zactor_t
139
+ # instance or a file handle as specified in zpoller_new/zpoller_add. The
140
+ # timeout should be zero or greater, or -1 to wait indefinitely. Socket
141
+ # priority is defined by their order in the poll list. If you need a
142
+ # balanced poll, use the low level zmq_poll method directly. If the poll
143
+ # call was interrupted (SIGINT), or the ZMQ context was destroyed, or the
144
+ # timeout expired, returns NULL. You can test the actual exit condition by
145
+ # calling zpoller_expired () and zpoller_terminated (). The timeout is in
146
+ # msec.
145
147
  #
146
148
  # @param timeout [Integer, #to_int, #to_i]
147
149
  # @return [::FFI::Pointer]
@@ -254,19 +254,33 @@ module CZMQ
254
254
  result
255
255
  end
256
256
 
257
+ # The timeout should be zero or greater, or -1 to wait indefinitely.
257
258
  # wait or poll process status, return return code
258
259
  #
259
- # @param hang [Boolean]
260
+ # @param timeout [Integer, #to_int, #to_i]
260
261
  # @return [Integer]
261
- def wait(hang)
262
+ def wait(timeout)
262
263
  raise DestroyedError unless @ptr
263
264
  self_p = @ptr
264
- hang = !(0==hang||!hang) # boolean
265
- result = ::CZMQ::FFI.zproc_wait(self_p, hang)
265
+ timeout = Integer(timeout)
266
+ result = ::CZMQ::FFI.zproc_wait(self_p, timeout)
266
267
  result
267
268
  end
268
269
 
269
- # return internal actor, usefull for the polling if process died
270
+ # send SIGTERM signal to the subprocess, wait for grace period and
271
+ # eventually send SIGKILL
272
+ #
273
+ # @param timeout [Integer, #to_int, #to_i]
274
+ # @return [void]
275
+ def shutdown(timeout)
276
+ raise DestroyedError unless @ptr
277
+ self_p = @ptr
278
+ timeout = Integer(timeout)
279
+ result = ::CZMQ::FFI.zproc_shutdown(self_p, timeout)
280
+ result
281
+ end
282
+
283
+ # return internal actor, useful for the polling if process died
270
284
  #
271
285
  # @return [::FFI::Pointer]
272
286
  def actor()
@@ -369,6 +369,7 @@ module CZMQ
369
369
  # c = zchunk_t *
370
370
  # f = zframe_t *
371
371
  # h = zhashx_t *
372
+ # l = zlistx_t * (DRAFT)
372
373
  # U = zuuid_t *
373
374
  # p = void * (sends the pointer value, only meaningful over inproc)
374
375
  # m = zmsg_t * (sends all frames in the zmsg)
@@ -406,6 +407,7 @@ module CZMQ
406
407
  # c = zchunk_t *
407
408
  # f = zframe_t *
408
409
  # h = zhashx_t *
410
+ # l = zlistx_t * (DRAFT)
409
411
  # U = zuuid_t *
410
412
  # p = void * (sends the pointer value, only meaningful over inproc)
411
413
  # m = zmsg_t * (sends all frames in the zmsg)
@@ -475,8 +477,9 @@ module CZMQ
475
477
  # f = zframe_t ** (creates zframe)
476
478
  # U = zuuid_t * (creates a zuuid with the data)
477
479
  # h = zhashx_t ** (creates zhashx)
480
+ # l = zlistx_t ** (creates zlistx) (DRAFT)
478
481
  # p = void ** (stores pointer)
479
- # m = zmsg_t ** (creates a zmsg with the remaing frames)
482
+ # m = zmsg_t ** (creates a zmsg with the remaining frames)
480
483
  # z = null, asserts empty frame (0 arguments)
481
484
  # u = uint * (stores unsigned integer, deprecated)
482
485
  #
@@ -512,8 +515,9 @@ module CZMQ
512
515
  # f = zframe_t ** (creates zframe)
513
516
  # U = zuuid_t * (creates a zuuid with the data)
514
517
  # h = zhashx_t ** (creates zhashx)
518
+ # l = zlistx_t ** (creates zlistx) (DRAFT)
515
519
  # p = void ** (stores pointer)
516
- # m = zmsg_t ** (creates a zmsg with the remaing frames)
520
+ # m = zmsg_t ** (creates a zmsg with the remaining frames)
517
521
  # z = null, asserts empty frame (0 arguments)
518
522
  # u = uint * (stores unsigned integer, deprecated)
519
523
  #
@@ -914,6 +918,461 @@ module CZMQ
914
918
  result
915
919
  end
916
920
 
921
+ # Check whether the socket has available message to read.
922
+ #
923
+ # @return [Boolean]
924
+ def has_in()
925
+ raise DestroyedError unless @ptr
926
+ self_p = @ptr
927
+ result = ::CZMQ::FFI.zsock_has_in(self_p)
928
+ result
929
+ end
930
+
931
+ # Check whether the socket has available message to read.
932
+ #
933
+ # This is the polymorphic version of #has_in.
934
+ #
935
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
936
+ # object reference to use this method on
937
+ # @return [Boolean]
938
+ def self.has_in(self_p)
939
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
940
+ result = ::CZMQ::FFI.zsock_has_in(self_p)
941
+ result
942
+ end
943
+
944
+ # Get socket option `router_notify`.
945
+ # Available from libzmq 4.3.0.
946
+ #
947
+ # @return [Integer]
948
+ def router_notify()
949
+ raise DestroyedError unless @ptr
950
+ self_p = @ptr
951
+ result = ::CZMQ::FFI.zsock_router_notify(self_p)
952
+ result
953
+ end
954
+
955
+ # Get socket option `router_notify`.
956
+ # Available from libzmq 4.3.0.
957
+ #
958
+ # This is the polymorphic version of #router_notify.
959
+ #
960
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
961
+ # object reference to use this method on
962
+ # @return [Integer]
963
+ def self.router_notify(self_p)
964
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
965
+ result = ::CZMQ::FFI.zsock_router_notify(self_p)
966
+ result
967
+ end
968
+
969
+ # Set socket option `router_notify`.
970
+ # Available from libzmq 4.3.0.
971
+ #
972
+ # @param router_notify [Integer, #to_int, #to_i]
973
+ # @return [void]
974
+ def set_router_notify(router_notify)
975
+ raise DestroyedError unless @ptr
976
+ self_p = @ptr
977
+ router_notify = Integer(router_notify)
978
+ result = ::CZMQ::FFI.zsock_set_router_notify(self_p, router_notify)
979
+ result
980
+ end
981
+
982
+ # Set socket option `router_notify`.
983
+ # Available from libzmq 4.3.0.
984
+ #
985
+ # This is the polymorphic version of #set_router_notify.
986
+ #
987
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
988
+ # object reference to use this method on
989
+ # @param router_notify [Integer, #to_int, #to_i]
990
+ # @return [void]
991
+ def self.set_router_notify(self_p, router_notify)
992
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
993
+ router_notify = Integer(router_notify)
994
+ result = ::CZMQ::FFI.zsock_set_router_notify(self_p, router_notify)
995
+ result
996
+ end
997
+
998
+ # Get socket option `multicast_loop`.
999
+ # Available from libzmq 4.3.0.
1000
+ #
1001
+ # @return [Integer]
1002
+ def multicast_loop()
1003
+ raise DestroyedError unless @ptr
1004
+ self_p = @ptr
1005
+ result = ::CZMQ::FFI.zsock_multicast_loop(self_p)
1006
+ result
1007
+ end
1008
+
1009
+ # Get socket option `multicast_loop`.
1010
+ # Available from libzmq 4.3.0.
1011
+ #
1012
+ # This is the polymorphic version of #multicast_loop.
1013
+ #
1014
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1015
+ # object reference to use this method on
1016
+ # @return [Integer]
1017
+ def self.multicast_loop(self_p)
1018
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1019
+ result = ::CZMQ::FFI.zsock_multicast_loop(self_p)
1020
+ result
1021
+ end
1022
+
1023
+ # Set socket option `multicast_loop`.
1024
+ # Available from libzmq 4.3.0.
1025
+ #
1026
+ # @param multicast_loop [Integer, #to_int, #to_i]
1027
+ # @return [void]
1028
+ def set_multicast_loop(multicast_loop)
1029
+ raise DestroyedError unless @ptr
1030
+ self_p = @ptr
1031
+ multicast_loop = Integer(multicast_loop)
1032
+ result = ::CZMQ::FFI.zsock_set_multicast_loop(self_p, multicast_loop)
1033
+ result
1034
+ end
1035
+
1036
+ # Set socket option `multicast_loop`.
1037
+ # Available from libzmq 4.3.0.
1038
+ #
1039
+ # This is the polymorphic version of #set_multicast_loop.
1040
+ #
1041
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1042
+ # object reference to use this method on
1043
+ # @param multicast_loop [Integer, #to_int, #to_i]
1044
+ # @return [void]
1045
+ def self.set_multicast_loop(self_p, multicast_loop)
1046
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1047
+ multicast_loop = Integer(multicast_loop)
1048
+ result = ::CZMQ::FFI.zsock_set_multicast_loop(self_p, multicast_loop)
1049
+ result
1050
+ end
1051
+
1052
+ # Get socket option `metadata`.
1053
+ # Available from libzmq 4.3.0.
1054
+ #
1055
+ # @return [::FFI::AutoPointer]
1056
+ def metadata()
1057
+ raise DestroyedError unless @ptr
1058
+ self_p = @ptr
1059
+ result = ::CZMQ::FFI.zsock_metadata(self_p)
1060
+ result = ::FFI::AutoPointer.new(result, LibC.method(:free))
1061
+ result
1062
+ end
1063
+
1064
+ # Get socket option `metadata`.
1065
+ # Available from libzmq 4.3.0.
1066
+ #
1067
+ # This is the polymorphic version of #metadata.
1068
+ #
1069
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1070
+ # object reference to use this method on
1071
+ # @return [::FFI::AutoPointer]
1072
+ def self.metadata(self_p)
1073
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1074
+ result = ::CZMQ::FFI.zsock_metadata(self_p)
1075
+ result = ::FFI::AutoPointer.new(result, LibC.method(:free))
1076
+ result
1077
+ end
1078
+
1079
+ # Set socket option `metadata`.
1080
+ # Available from libzmq 4.3.0.
1081
+ #
1082
+ # @param metadata [String, #to_s, nil]
1083
+ # @return [void]
1084
+ def set_metadata(metadata)
1085
+ raise DestroyedError unless @ptr
1086
+ self_p = @ptr
1087
+ result = ::CZMQ::FFI.zsock_set_metadata(self_p, metadata)
1088
+ result
1089
+ end
1090
+
1091
+ # Set socket option `metadata`.
1092
+ # Available from libzmq 4.3.0.
1093
+ #
1094
+ # This is the polymorphic version of #set_metadata.
1095
+ #
1096
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1097
+ # object reference to use this method on
1098
+ # @param metadata [String, #to_s, nil]
1099
+ # @return [void]
1100
+ def self.set_metadata(self_p, metadata)
1101
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1102
+ result = ::CZMQ::FFI.zsock_set_metadata(self_p, metadata)
1103
+ result
1104
+ end
1105
+
1106
+ # Get socket option `loopback_fastpath`.
1107
+ # Available from libzmq 4.3.0.
1108
+ #
1109
+ # @return [Integer]
1110
+ def loopback_fastpath()
1111
+ raise DestroyedError unless @ptr
1112
+ self_p = @ptr
1113
+ result = ::CZMQ::FFI.zsock_loopback_fastpath(self_p)
1114
+ result
1115
+ end
1116
+
1117
+ # Get socket option `loopback_fastpath`.
1118
+ # Available from libzmq 4.3.0.
1119
+ #
1120
+ # This is the polymorphic version of #loopback_fastpath.
1121
+ #
1122
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1123
+ # object reference to use this method on
1124
+ # @return [Integer]
1125
+ def self.loopback_fastpath(self_p)
1126
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1127
+ result = ::CZMQ::FFI.zsock_loopback_fastpath(self_p)
1128
+ result
1129
+ end
1130
+
1131
+ # Set socket option `loopback_fastpath`.
1132
+ # Available from libzmq 4.3.0.
1133
+ #
1134
+ # @param loopback_fastpath [Integer, #to_int, #to_i]
1135
+ # @return [void]
1136
+ def set_loopback_fastpath(loopback_fastpath)
1137
+ raise DestroyedError unless @ptr
1138
+ self_p = @ptr
1139
+ loopback_fastpath = Integer(loopback_fastpath)
1140
+ result = ::CZMQ::FFI.zsock_set_loopback_fastpath(self_p, loopback_fastpath)
1141
+ result
1142
+ end
1143
+
1144
+ # Set socket option `loopback_fastpath`.
1145
+ # Available from libzmq 4.3.0.
1146
+ #
1147
+ # This is the polymorphic version of #set_loopback_fastpath.
1148
+ #
1149
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1150
+ # object reference to use this method on
1151
+ # @param loopback_fastpath [Integer, #to_int, #to_i]
1152
+ # @return [void]
1153
+ def self.set_loopback_fastpath(self_p, loopback_fastpath)
1154
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1155
+ loopback_fastpath = Integer(loopback_fastpath)
1156
+ result = ::CZMQ::FFI.zsock_set_loopback_fastpath(self_p, loopback_fastpath)
1157
+ result
1158
+ end
1159
+
1160
+ # Get socket option `zap_enforce_domain`.
1161
+ # Available from libzmq 4.3.0.
1162
+ #
1163
+ # @return [Integer]
1164
+ def zap_enforce_domain()
1165
+ raise DestroyedError unless @ptr
1166
+ self_p = @ptr
1167
+ result = ::CZMQ::FFI.zsock_zap_enforce_domain(self_p)
1168
+ result
1169
+ end
1170
+
1171
+ # Get socket option `zap_enforce_domain`.
1172
+ # Available from libzmq 4.3.0.
1173
+ #
1174
+ # This is the polymorphic version of #zap_enforce_domain.
1175
+ #
1176
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1177
+ # object reference to use this method on
1178
+ # @return [Integer]
1179
+ def self.zap_enforce_domain(self_p)
1180
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1181
+ result = ::CZMQ::FFI.zsock_zap_enforce_domain(self_p)
1182
+ result
1183
+ end
1184
+
1185
+ # Set socket option `zap_enforce_domain`.
1186
+ # Available from libzmq 4.3.0.
1187
+ #
1188
+ # @param zap_enforce_domain [Integer, #to_int, #to_i]
1189
+ # @return [void]
1190
+ def set_zap_enforce_domain(zap_enforce_domain)
1191
+ raise DestroyedError unless @ptr
1192
+ self_p = @ptr
1193
+ zap_enforce_domain = Integer(zap_enforce_domain)
1194
+ result = ::CZMQ::FFI.zsock_set_zap_enforce_domain(self_p, zap_enforce_domain)
1195
+ result
1196
+ end
1197
+
1198
+ # Set socket option `zap_enforce_domain`.
1199
+ # Available from libzmq 4.3.0.
1200
+ #
1201
+ # This is the polymorphic version of #set_zap_enforce_domain.
1202
+ #
1203
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1204
+ # object reference to use this method on
1205
+ # @param zap_enforce_domain [Integer, #to_int, #to_i]
1206
+ # @return [void]
1207
+ def self.set_zap_enforce_domain(self_p, zap_enforce_domain)
1208
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1209
+ zap_enforce_domain = Integer(zap_enforce_domain)
1210
+ result = ::CZMQ::FFI.zsock_set_zap_enforce_domain(self_p, zap_enforce_domain)
1211
+ result
1212
+ end
1213
+
1214
+ # Get socket option `gssapi_principal_nametype`.
1215
+ # Available from libzmq 4.3.0.
1216
+ #
1217
+ # @return [Integer]
1218
+ def gssapi_principal_nametype()
1219
+ raise DestroyedError unless @ptr
1220
+ self_p = @ptr
1221
+ result = ::CZMQ::FFI.zsock_gssapi_principal_nametype(self_p)
1222
+ result
1223
+ end
1224
+
1225
+ # Get socket option `gssapi_principal_nametype`.
1226
+ # Available from libzmq 4.3.0.
1227
+ #
1228
+ # This is the polymorphic version of #gssapi_principal_nametype.
1229
+ #
1230
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1231
+ # object reference to use this method on
1232
+ # @return [Integer]
1233
+ def self.gssapi_principal_nametype(self_p)
1234
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1235
+ result = ::CZMQ::FFI.zsock_gssapi_principal_nametype(self_p)
1236
+ result
1237
+ end
1238
+
1239
+ # Set socket option `gssapi_principal_nametype`.
1240
+ # Available from libzmq 4.3.0.
1241
+ #
1242
+ # @param gssapi_principal_nametype [Integer, #to_int, #to_i]
1243
+ # @return [void]
1244
+ def set_gssapi_principal_nametype(gssapi_principal_nametype)
1245
+ raise DestroyedError unless @ptr
1246
+ self_p = @ptr
1247
+ gssapi_principal_nametype = Integer(gssapi_principal_nametype)
1248
+ result = ::CZMQ::FFI.zsock_set_gssapi_principal_nametype(self_p, gssapi_principal_nametype)
1249
+ result
1250
+ end
1251
+
1252
+ # Set socket option `gssapi_principal_nametype`.
1253
+ # Available from libzmq 4.3.0.
1254
+ #
1255
+ # This is the polymorphic version of #set_gssapi_principal_nametype.
1256
+ #
1257
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1258
+ # object reference to use this method on
1259
+ # @param gssapi_principal_nametype [Integer, #to_int, #to_i]
1260
+ # @return [void]
1261
+ def self.set_gssapi_principal_nametype(self_p, gssapi_principal_nametype)
1262
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1263
+ gssapi_principal_nametype = Integer(gssapi_principal_nametype)
1264
+ result = ::CZMQ::FFI.zsock_set_gssapi_principal_nametype(self_p, gssapi_principal_nametype)
1265
+ result
1266
+ end
1267
+
1268
+ # Get socket option `gssapi_service_principal_nametype`.
1269
+ # Available from libzmq 4.3.0.
1270
+ #
1271
+ # @return [Integer]
1272
+ def gssapi_service_principal_nametype()
1273
+ raise DestroyedError unless @ptr
1274
+ self_p = @ptr
1275
+ result = ::CZMQ::FFI.zsock_gssapi_service_principal_nametype(self_p)
1276
+ result
1277
+ end
1278
+
1279
+ # Get socket option `gssapi_service_principal_nametype`.
1280
+ # Available from libzmq 4.3.0.
1281
+ #
1282
+ # This is the polymorphic version of #gssapi_service_principal_nametype.
1283
+ #
1284
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1285
+ # object reference to use this method on
1286
+ # @return [Integer]
1287
+ def self.gssapi_service_principal_nametype(self_p)
1288
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1289
+ result = ::CZMQ::FFI.zsock_gssapi_service_principal_nametype(self_p)
1290
+ result
1291
+ end
1292
+
1293
+ # Set socket option `gssapi_service_principal_nametype`.
1294
+ # Available from libzmq 4.3.0.
1295
+ #
1296
+ # @param gssapi_service_principal_nametype [Integer, #to_int, #to_i]
1297
+ # @return [void]
1298
+ def set_gssapi_service_principal_nametype(gssapi_service_principal_nametype)
1299
+ raise DestroyedError unless @ptr
1300
+ self_p = @ptr
1301
+ gssapi_service_principal_nametype = Integer(gssapi_service_principal_nametype)
1302
+ result = ::CZMQ::FFI.zsock_set_gssapi_service_principal_nametype(self_p, gssapi_service_principal_nametype)
1303
+ result
1304
+ end
1305
+
1306
+ # Set socket option `gssapi_service_principal_nametype`.
1307
+ # Available from libzmq 4.3.0.
1308
+ #
1309
+ # This is the polymorphic version of #set_gssapi_service_principal_nametype.
1310
+ #
1311
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1312
+ # object reference to use this method on
1313
+ # @param gssapi_service_principal_nametype [Integer, #to_int, #to_i]
1314
+ # @return [void]
1315
+ def self.set_gssapi_service_principal_nametype(self_p, gssapi_service_principal_nametype)
1316
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1317
+ gssapi_service_principal_nametype = Integer(gssapi_service_principal_nametype)
1318
+ result = ::CZMQ::FFI.zsock_set_gssapi_service_principal_nametype(self_p, gssapi_service_principal_nametype)
1319
+ result
1320
+ end
1321
+
1322
+ # Get socket option `bindtodevice`.
1323
+ # Available from libzmq 4.3.0.
1324
+ #
1325
+ # @return [::FFI::AutoPointer]
1326
+ def bindtodevice()
1327
+ raise DestroyedError unless @ptr
1328
+ self_p = @ptr
1329
+ result = ::CZMQ::FFI.zsock_bindtodevice(self_p)
1330
+ result = ::FFI::AutoPointer.new(result, LibC.method(:free))
1331
+ result
1332
+ end
1333
+
1334
+ # Get socket option `bindtodevice`.
1335
+ # Available from libzmq 4.3.0.
1336
+ #
1337
+ # This is the polymorphic version of #bindtodevice.
1338
+ #
1339
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1340
+ # object reference to use this method on
1341
+ # @return [::FFI::AutoPointer]
1342
+ def self.bindtodevice(self_p)
1343
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1344
+ result = ::CZMQ::FFI.zsock_bindtodevice(self_p)
1345
+ result = ::FFI::AutoPointer.new(result, LibC.method(:free))
1346
+ result
1347
+ end
1348
+
1349
+ # Set socket option `bindtodevice`.
1350
+ # Available from libzmq 4.3.0.
1351
+ #
1352
+ # @param bindtodevice [String, #to_s, nil]
1353
+ # @return [void]
1354
+ def set_bindtodevice(bindtodevice)
1355
+ raise DestroyedError unless @ptr
1356
+ self_p = @ptr
1357
+ result = ::CZMQ::FFI.zsock_set_bindtodevice(self_p, bindtodevice)
1358
+ result
1359
+ end
1360
+
1361
+ # Set socket option `bindtodevice`.
1362
+ # Available from libzmq 4.3.0.
1363
+ #
1364
+ # This is the polymorphic version of #set_bindtodevice.
1365
+ #
1366
+ # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1367
+ # object reference to use this method on
1368
+ # @param bindtodevice [String, #to_s, nil]
1369
+ # @return [void]
1370
+ def self.set_bindtodevice(self_p, bindtodevice)
1371
+ self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1372
+ result = ::CZMQ::FFI.zsock_set_bindtodevice(self_p, bindtodevice)
1373
+ result
1374
+ end
1375
+
917
1376
  # Get socket option `heartbeat_ivl`.
918
1377
  # Available from libzmq 4.2.0.
919
1378
  #