1 /*
2 ################################################################################
3 #  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
4 #  Read the zproject/README.md for information about making permanent changes. #
5 ################################################################################
6 */
7 
8 #ifndef QML_ZSOCK_H
9 #define QML_ZSOCK_H
10 
11 #include <QtQml>
12 
13 #include <czmq.h>
14 #include "qml_czmq_plugin.h"
15 
16 
17 class QmlZsock : public QObject
18 {
19     Q_OBJECT
20     Q_PROPERTY(bool isNULL READ isNULL)
21 
22 public:
23     zsock_t *self;
24 
QmlZsock()25     QmlZsock() { self = NULL; }
isNULL()26     bool isNULL() { return self == NULL; }
27 
28     static QObject* qmlAttachedProperties(QObject* object); // defined in QmlZsock.cpp
29 
30 public slots:
31     //  Bind a socket to a formatted endpoint. For tcp:// endpoints, supports
32     //  ephemeral ports, if you specify the port number as "*". By default
33     //  zsock uses the IANA designated range from C000 (49152) to FFFF (65535).
34     //  To override this range, follow the "*" with "[first-last]". Either or
35     //  both first and last may be empty. To bind to a random port within the
36     //  range, use "!" in place of "*".
37     //
38     //  Examples:
39     //      tcp://127.0.0.1:*           bind to first free port from C000 up
40     //      tcp://127.0.0.1:!           bind to random port from C000 to FFFF
41     //      tcp://127.0.0.1:*[60000-]   bind to first free port from 60000 up
42     //      tcp://127.0.0.1:![-60000]   bind to random port from C000 to 60000
43     //      tcp://127.0.0.1:![55000-55999]
44     //                                  bind to random port from 55000 to 55999
45     //
46     //  On success, returns the actual port number used, for tcp:// endpoints,
47     //  and 0 for other transports. On failure, returns -1. Note that when using
48     //  ephemeral ports, a port may be reused by different services without
49     //  clients being aware. Protocols that run on ephemeral ports should take
50     //  this into account.
51     int bind (const QString &format);
52 
53     //  Returns last bound endpoint, if any.
54     const QString endpoint ();
55 
56     //  Unbind a socket from a formatted endpoint.
57     //  Returns 0 if OK, -1 if the endpoint was invalid or the function
58     //  isn't supported.
59     int unbind (const QString &format);
60 
61     //  Connect a socket to a formatted endpoint
62     //  Returns 0 if OK, -1 if the endpoint was invalid.
63     int connect (const QString &format);
64 
65     //  Disconnect a socket from a formatted endpoint
66     //  Returns 0 if OK, -1 if the endpoint was invalid or the function
67     //  isn't supported.
68     int disconnect (const QString &format);
69 
70     //  Attach a socket to zero or more endpoints. If endpoints is not null,
71     //  parses as list of ZeroMQ endpoints, separated by commas, and prefixed by
72     //  '@' (to bind the socket) or '>' (to connect the socket). Returns 0 if all
73     //  endpoints were valid, or -1 if there was a syntax error. If the endpoint
74     //  does not start with '@' or '>', the serverish argument defines whether
75     //  it is used to bind (serverish = true) or connect (serverish = false).
76     int attach (const QString &endpoints, bool serverish);
77 
78     //  Returns socket type as printable constant string.
79     const QString typeStr ();
80 
81     //  Send a 'picture' message to the socket (or actor). The picture is a
82     //  string that defines the type of each frame. This makes it easy to send
83     //  a complex multiframe message in one call. The picture can contain any
84     //  of these characters, each corresponding to one or two arguments:
85     //
86     //      i = int (signed)
87     //      1 = uint8_t
88     //      2 = uint16_t
89     //      4 = uint32_t
90     //      8 = uint64_t
91     //      s = char *
92     //      b = byte *, size_t (2 arguments)
93     //      c = zchunk_t *
94     //      f = zframe_t *
95     //      h = zhashx_t *
96     //      l = zlistx_t * (DRAFT)
97     //      U = zuuid_t *
98     //      p = void * (sends the pointer value, only meaningful over inproc)
99     //      m = zmsg_t * (sends all frames in the zmsg)
100     //      z = sends zero-sized frame (0 arguments)
101     //      u = uint (deprecated)
102     //
103     //  Note that s, b, c, and f are encoded the same way and the choice is
104     //  offered as a convenience to the sender, which may or may not already
105     //  have data in a zchunk or zframe. Does not change or take ownership of
106     //  any arguments. Returns 0 if successful, -1 if sending failed for any
107     //  reason.
108     int send (const QString &picture);
109 
110     //  Send a 'picture' message to the socket (or actor). This is a va_list
111     //  version of zsock_send (), so please consult its documentation for the
112     //  details.
113     int vsend (const QString &picture, va_list argptr);
114 
115     //  Receive a 'picture' message to the socket (or actor). See zsock_send for
116     //  the format and meaning of the picture. Returns the picture elements into
117     //  a series of pointers as provided by the caller:
118     //
119     //      i = int * (stores signed integer)
120     //      4 = uint32_t * (stores 32-bit unsigned integer)
121     //      8 = uint64_t * (stores 64-bit unsigned integer)
122     //      s = char ** (allocates new string)
123     //      b = byte **, size_t * (2 arguments) (allocates memory)
124     //      c = zchunk_t ** (creates zchunk)
125     //      f = zframe_t ** (creates zframe)
126     //      U = zuuid_t * (creates a zuuid with the data)
127     //      h = zhashx_t ** (creates zhashx)
128     //      l = zlistx_t ** (creates zlistx) (DRAFT)
129     //      p = void ** (stores pointer)
130     //      m = zmsg_t ** (creates a zmsg with the remaining frames)
131     //      z = null, asserts empty frame (0 arguments)
132     //      u = uint * (stores unsigned integer, deprecated)
133     //
134     //  Note that zsock_recv creates the returned objects, and the caller must
135     //  destroy them when finished with them. The supplied pointers do not need
136     //  to be initialized. Returns 0 if successful, or -1 if it failed to recv
137     //  a message, in which case the pointers are not modified. When message
138     //  frames are truncated (a short message), sets return values to zero/null.
139     //  If an argument pointer is NULL, does not store any value (skips it).
140     //  An 'n' picture matches an empty frame; if the message does not match,
141     //  the method will return -1.
142     int recv (const QString &picture);
143 
144     //  Receive a 'picture' message from the socket (or actor). This is a
145     //  va_list version of zsock_recv (), so please consult its documentation
146     //  for the details.
147     int vrecv (const QString &picture, va_list argptr);
148 
149     //  Send a binary encoded 'picture' message to the socket (or actor). This
150     //  method is similar to zsock_send, except the arguments are encoded in a
151     //  binary format that is compatible with zproto, and is designed to reduce
152     //  memory allocations. The pattern argument is a string that defines the
153     //  type of each argument. Supports these argument types:
154     //
155     //   pattern    C type                  zproto type:
156     //      1       uint8_t                 type = "number" size = "1"
157     //      2       uint16_t                type = "number" size = "2"
158     //      4       uint32_t                type = "number" size = "3"
159     //      8       uint64_t                type = "number" size = "4"
160     //      s       char *, 0-255 chars     type = "string"
161     //      S       char *, 0-2^32-1 chars  type = "longstr"
162     //      c       zchunk_t *              type = "chunk"
163     //      f       zframe_t *              type = "frame"
164     //      u       zuuid_t *               type = "uuid"
165     //      m       zmsg_t *                type = "msg"
166     //      p       void *, sends pointer value, only over inproc
167     //
168     //  Does not change or take ownership of any arguments. Returns 0 if
169     //  successful, -1 if sending failed for any reason.
170     int bsend (const QString &picture);
171 
172     //  Receive a binary encoded 'picture' message from the socket (or actor).
173     //  This method is similar to zsock_recv, except the arguments are encoded
174     //  in a binary format that is compatible with zproto, and is designed to
175     //  reduce memory allocations. The pattern argument is a string that defines
176     //  the type of each argument. See zsock_bsend for the supported argument
177     //  types. All arguments must be pointers; this call sets them to point to
178     //  values held on a per-socket basis.
179     //  For types 1, 2, 4 and 8 the caller must allocate the memory itself before
180     //  calling zsock_brecv.
181     //  For types S, the caller must free the value once finished with it, as
182     //  zsock_brecv will allocate the buffer.
183     //  For type s, the caller must not free the value as it is stored in a
184     //  local cache for performance purposes.
185     //  For types c, f, u and m the caller must call the appropriate destructor
186     //  depending on the object as zsock_brecv will create new objects.
187     //  For type p the caller must coordinate with the sender, as it is just a
188     //  pointer value being passed.
189     int brecv (const QString &picture);
190 
191     //  Return socket routing ID if any. This returns 0 if the socket is not
192     //  of type ZMQ_SERVER or if no request was already received on it.
193     uint32_t routingId ();
194 
195     //  Set routing ID on socket. The socket MUST be of type ZMQ_SERVER.
196     //  This will be used when sending messages on the socket via the zsock API.
197     void setRoutingId (uint32_t routingId);
198 
199     //  Set socket to use unbounded pipes (HWM=0); use this in cases when you are
200     //  totally certain the message volume can fit in memory. This method works
201     //  across all versions of ZeroMQ. Takes a polymorphic socket reference.
202     void setUnbounded ();
203 
204     //  Send a signal over a socket. A signal is a short message carrying a
205     //  success/failure code (by convention, 0 means OK). Signals are encoded
206     //  to be distinguishable from "normal" messages. Accepts a zsock_t or a
207     //  zactor_t argument, and returns 0 if successful, -1 if the signal could
208     //  not be sent. Takes a polymorphic socket reference.
209     int signal (byte status);
210 
211     //  Wait on a signal. Use this to coordinate between threads, over pipe
212     //  pairs. Blocks until the signal is received. Returns -1 on error, 0 or
213     //  greater on success. Accepts a zsock_t or a zactor_t as argument.
214     //  Takes a polymorphic socket reference.
215     int wait ();
216 
217     //  If there is a partial message still waiting on the socket, remove and
218     //  discard it. This is useful when reading partial messages, to get specific
219     //  message types.
220     void flush ();
221 
222     //  Join a group for the RADIO-DISH pattern. Call only on ZMQ_DISH.
223     //  Returns 0 if OK, -1 if failed.
224     int join (const QString &group);
225 
226     //  Leave a group for the RADIO-DISH pattern. Call only on ZMQ_DISH.
227     //  Returns 0 if OK, -1 if failed.
228     int leave (const QString &group);
229 
230     //  Check whether the socket has available message to read.
231     bool hasIn ();
232 
233     //  Get socket option `priority`.
234     //  Available from libzmq 4.3.0.
235     int priority ();
236 
237     //  Set socket option `priority`.
238     //  Available from libzmq 4.3.0.
239     void setPriority (int priority);
240 
241     //  Get socket option `reconnect_stop`.
242     //  Available from libzmq 4.3.0.
243     int reconnectStop ();
244 
245     //  Set socket option `reconnect_stop`.
246     //  Available from libzmq 4.3.0.
247     void setReconnectStop (int reconnectStop);
248 
249     //  Set socket option `only_first_subscribe`.
250     //  Available from libzmq 4.3.0.
251     void setOnlyFirstSubscribe (int onlyFirstSubscribe);
252 
253     //  Set socket option `hello_msg`.
254     //  Available from libzmq 4.3.0.
255     void setHelloMsg (QmlZframe *helloMsg);
256 
257     //  Set socket option `disconnect_msg`.
258     //  Available from libzmq 4.3.0.
259     void setDisconnectMsg (QmlZframe *disconnectMsg);
260 
261     //  Set socket option `wss_trust_system`.
262     //  Available from libzmq 4.3.0.
263     void setWssTrustSystem (int wssTrustSystem);
264 
265     //  Set socket option `wss_hostname`.
266     //  Available from libzmq 4.3.0.
267     void setWssHostname (const QString &wssHostname);
268 
269     //  Set socket option `wss_trust_pem`.
270     //  Available from libzmq 4.3.0.
271     void setWssTrustPem (const QString &wssTrustPem);
272 
273     //  Set socket option `wss_cert_pem`.
274     //  Available from libzmq 4.3.0.
275     void setWssCertPem (const QString &wssCertPem);
276 
277     //  Set socket option `wss_key_pem`.
278     //  Available from libzmq 4.3.0.
279     void setWssKeyPem (const QString &wssKeyPem);
280 
281     //  Get socket option `out_batch_size`.
282     //  Available from libzmq 4.3.0.
283     int outBatchSize ();
284 
285     //  Set socket option `out_batch_size`.
286     //  Available from libzmq 4.3.0.
287     void setOutBatchSize (int outBatchSize);
288 
289     //  Get socket option `in_batch_size`.
290     //  Available from libzmq 4.3.0.
291     int inBatchSize ();
292 
293     //  Set socket option `in_batch_size`.
294     //  Available from libzmq 4.3.0.
295     void setInBatchSize (int inBatchSize);
296 
297     //  Get socket option `socks_password`.
298     //  Available from libzmq 4.3.0.
299     QString socksPassword ();
300 
301     //  Set socket option `socks_password`.
302     //  Available from libzmq 4.3.0.
303     void setSocksPassword (const QString &socksPassword);
304 
305     //  Get socket option `socks_username`.
306     //  Available from libzmq 4.3.0.
307     QString socksUsername ();
308 
309     //  Set socket option `socks_username`.
310     //  Available from libzmq 4.3.0.
311     void setSocksUsername (const QString &socksUsername);
312 
313     //  Set socket option `xpub_manual_last_value`.
314     //  Available from libzmq 4.3.0.
315     void setXpubManualLastValue (int xpubManualLastValue);
316 
317     //  Get socket option `router_notify`.
318     //  Available from libzmq 4.3.0.
319     int routerNotify ();
320 
321     //  Set socket option `router_notify`.
322     //  Available from libzmq 4.3.0.
323     void setRouterNotify (int routerNotify);
324 
325     //  Get socket option `multicast_loop`.
326     //  Available from libzmq 4.3.0.
327     int multicastLoop ();
328 
329     //  Set socket option `multicast_loop`.
330     //  Available from libzmq 4.3.0.
331     void setMulticastLoop (int multicastLoop);
332 
333     //  Get socket option `metadata`.
334     //  Available from libzmq 4.3.0.
335     QString metadata ();
336 
337     //  Set socket option `metadata`.
338     //  Available from libzmq 4.3.0.
339     void setMetadata (const QString &metadata);
340 
341     //  Get socket option `loopback_fastpath`.
342     //  Available from libzmq 4.3.0.
343     int loopbackFastpath ();
344 
345     //  Set socket option `loopback_fastpath`.
346     //  Available from libzmq 4.3.0.
347     void setLoopbackFastpath (int loopbackFastpath);
348 
349     //  Get socket option `zap_enforce_domain`.
350     //  Available from libzmq 4.3.0.
351     int zapEnforceDomain ();
352 
353     //  Set socket option `zap_enforce_domain`.
354     //  Available from libzmq 4.3.0.
355     void setZapEnforceDomain (int zapEnforceDomain);
356 
357     //  Get socket option `gssapi_principal_nametype`.
358     //  Available from libzmq 4.3.0.
359     int gssapiPrincipalNametype ();
360 
361     //  Set socket option `gssapi_principal_nametype`.
362     //  Available from libzmq 4.3.0.
363     void setGssapiPrincipalNametype (int gssapiPrincipalNametype);
364 
365     //  Get socket option `gssapi_service_principal_nametype`.
366     //  Available from libzmq 4.3.0.
367     int gssapiServicePrincipalNametype ();
368 
369     //  Set socket option `gssapi_service_principal_nametype`.
370     //  Available from libzmq 4.3.0.
371     void setGssapiServicePrincipalNametype (int gssapiServicePrincipalNametype);
372 
373     //  Get socket option `bindtodevice`.
374     //  Available from libzmq 4.3.0.
375     QString bindtodevice ();
376 
377     //  Set socket option `bindtodevice`.
378     //  Available from libzmq 4.3.0.
379     void setBindtodevice (const QString &bindtodevice);
380 
381     //  Get socket option `heartbeat_ivl`.
382     //  Available from libzmq 4.2.0.
383     int heartbeatIvl ();
384 
385     //  Set socket option `heartbeat_ivl`.
386     //  Available from libzmq 4.2.0.
387     void setHeartbeatIvl (int heartbeatIvl);
388 
389     //  Get socket option `heartbeat_ttl`.
390     //  Available from libzmq 4.2.0.
391     int heartbeatTtl ();
392 
393     //  Set socket option `heartbeat_ttl`.
394     //  Available from libzmq 4.2.0.
395     void setHeartbeatTtl (int heartbeatTtl);
396 
397     //  Get socket option `heartbeat_timeout`.
398     //  Available from libzmq 4.2.0.
399     int heartbeatTimeout ();
400 
401     //  Set socket option `heartbeat_timeout`.
402     //  Available from libzmq 4.2.0.
403     void setHeartbeatTimeout (int heartbeatTimeout);
404 
405     //  Get socket option `use_fd`.
406     //  Available from libzmq 4.2.0.
407     int useFd ();
408 
409     //  Set socket option `use_fd`.
410     //  Available from libzmq 4.2.0.
411     void setUseFd (int useFd);
412 
413     //  Set socket option `xpub_manual`.
414     //  Available from libzmq 4.2.0.
415     void setXpubManual (int xpubManual);
416 
417     //  Set socket option `xpub_welcome_msg`.
418     //  Available from libzmq 4.2.0.
419     void setXpubWelcomeMsg (const QString &xpubWelcomeMsg);
420 
421     //  Set socket option `stream_notify`.
422     //  Available from libzmq 4.2.0.
423     void setStreamNotify (int streamNotify);
424 
425     //  Get socket option `invert_matching`.
426     //  Available from libzmq 4.2.0.
427     int invertMatching ();
428 
429     //  Set socket option `invert_matching`.
430     //  Available from libzmq 4.2.0.
431     void setInvertMatching (int invertMatching);
432 
433     //  Set socket option `xpub_verboser`.
434     //  Available from libzmq 4.2.0.
435     void setXpubVerboser (int xpubVerboser);
436 
437     //  Get socket option `connect_timeout`.
438     //  Available from libzmq 4.2.0.
439     int connectTimeout ();
440 
441     //  Set socket option `connect_timeout`.
442     //  Available from libzmq 4.2.0.
443     void setConnectTimeout (int connectTimeout);
444 
445     //  Get socket option `tcp_maxrt`.
446     //  Available from libzmq 4.2.0.
447     int tcpMaxrt ();
448 
449     //  Set socket option `tcp_maxrt`.
450     //  Available from libzmq 4.2.0.
451     void setTcpMaxrt (int tcpMaxrt);
452 
453     //  Get socket option `thread_safe`.
454     //  Available from libzmq 4.2.0.
455     int threadSafe ();
456 
457     //  Get socket option `multicast_maxtpdu`.
458     //  Available from libzmq 4.2.0.
459     int multicastMaxtpdu ();
460 
461     //  Set socket option `multicast_maxtpdu`.
462     //  Available from libzmq 4.2.0.
463     void setMulticastMaxtpdu (int multicastMaxtpdu);
464 
465     //  Get socket option `vmci_buffer_size`.
466     //  Available from libzmq 4.2.0.
467     int vmciBufferSize ();
468 
469     //  Set socket option `vmci_buffer_size`.
470     //  Available from libzmq 4.2.0.
471     void setVmciBufferSize (int vmciBufferSize);
472 
473     //  Get socket option `vmci_buffer_min_size`.
474     //  Available from libzmq 4.2.0.
475     int vmciBufferMinSize ();
476 
477     //  Set socket option `vmci_buffer_min_size`.
478     //  Available from libzmq 4.2.0.
479     void setVmciBufferMinSize (int vmciBufferMinSize);
480 
481     //  Get socket option `vmci_buffer_max_size`.
482     //  Available from libzmq 4.2.0.
483     int vmciBufferMaxSize ();
484 
485     //  Set socket option `vmci_buffer_max_size`.
486     //  Available from libzmq 4.2.0.
487     void setVmciBufferMaxSize (int vmciBufferMaxSize);
488 
489     //  Get socket option `vmci_connect_timeout`.
490     //  Available from libzmq 4.2.0.
491     int vmciConnectTimeout ();
492 
493     //  Set socket option `vmci_connect_timeout`.
494     //  Available from libzmq 4.2.0.
495     void setVmciConnectTimeout (int vmciConnectTimeout);
496 
497     //  Get socket option `tos`.
498     //  Available from libzmq 4.1.0.
499     int tos ();
500 
501     //  Set socket option `tos`.
502     //  Available from libzmq 4.1.0.
503     void setTos (int tos);
504 
505     //  Set socket option `router_handover`.
506     //  Available from libzmq 4.1.0.
507     void setRouterHandover (int routerHandover);
508 
509     //  Set socket option `connect_rid`.
510     //  Available from libzmq 4.1.0.
511     void setConnectRid (const QString &connectRid);
512 
513     //  Set socket option `connect_rid` from 32-octet binary
514     //  Available from libzmq 4.1.0.
515     void setConnectRidBin (const byte *connectRid);
516 
517     //  Get socket option `handshake_ivl`.
518     //  Available from libzmq 4.1.0.
519     int handshakeIvl ();
520 
521     //  Set socket option `handshake_ivl`.
522     //  Available from libzmq 4.1.0.
523     void setHandshakeIvl (int handshakeIvl);
524 
525     //  Get socket option `socks_proxy`.
526     //  Available from libzmq 4.1.0.
527     QString socksProxy ();
528 
529     //  Set socket option `socks_proxy`.
530     //  Available from libzmq 4.1.0.
531     void setSocksProxy (const QString &socksProxy);
532 
533     //  Set socket option `xpub_nodrop`.
534     //  Available from libzmq 4.1.0.
535     void setXpubNodrop (int xpubNodrop);
536 
537     //  Set socket option `router_mandatory`.
538     //  Available from libzmq 4.0.0.
539     void setRouterMandatory (int routerMandatory);
540 
541     //  Set socket option `probe_router`.
542     //  Available from libzmq 4.0.0.
543     void setProbeRouter (int probeRouter);
544 
545     //  Set socket option `req_relaxed`.
546     //  Available from libzmq 4.0.0.
547     void setReqRelaxed (int reqRelaxed);
548 
549     //  Set socket option `req_correlate`.
550     //  Available from libzmq 4.0.0.
551     void setReqCorrelate (int reqCorrelate);
552 
553     //  Set socket option `conflate`.
554     //  Available from libzmq 4.0.0.
555     void setConflate (int conflate);
556 
557     //  Get socket option `zap_domain`.
558     //  Available from libzmq 4.0.0.
559     QString zapDomain ();
560 
561     //  Set socket option `zap_domain`.
562     //  Available from libzmq 4.0.0.
563     void setZapDomain (const QString &zapDomain);
564 
565     //  Get socket option `mechanism`.
566     //  Available from libzmq 4.0.0.
567     int mechanism ();
568 
569     //  Get socket option `plain_server`.
570     //  Available from libzmq 4.0.0.
571     int plainServer ();
572 
573     //  Set socket option `plain_server`.
574     //  Available from libzmq 4.0.0.
575     void setPlainServer (int plainServer);
576 
577     //  Get socket option `plain_username`.
578     //  Available from libzmq 4.0.0.
579     QString plainUsername ();
580 
581     //  Set socket option `plain_username`.
582     //  Available from libzmq 4.0.0.
583     void setPlainUsername (const QString &plainUsername);
584 
585     //  Get socket option `plain_password`.
586     //  Available from libzmq 4.0.0.
587     QString plainPassword ();
588 
589     //  Set socket option `plain_password`.
590     //  Available from libzmq 4.0.0.
591     void setPlainPassword (const QString &plainPassword);
592 
593     //  Get socket option `curve_server`.
594     //  Available from libzmq 4.0.0.
595     int curveServer ();
596 
597     //  Set socket option `curve_server`.
598     //  Available from libzmq 4.0.0.
599     void setCurveServer (int curveServer);
600 
601     //  Get socket option `curve_publickey`.
602     //  Available from libzmq 4.0.0.
603     QString curvePublickey ();
604 
605     //  Set socket option `curve_publickey`.
606     //  Available from libzmq 4.0.0.
607     void setCurvePublickey (const QString &curvePublickey);
608 
609     //  Set socket option `curve_publickey` from 32-octet binary
610     //  Available from libzmq 4.0.0.
611     void setCurvePublickeyBin (const byte *curvePublickey);
612 
613     //  Get socket option `curve_secretkey`.
614     //  Available from libzmq 4.0.0.
615     QString curveSecretkey ();
616 
617     //  Set socket option `curve_secretkey`.
618     //  Available from libzmq 4.0.0.
619     void setCurveSecretkey (const QString &curveSecretkey);
620 
621     //  Set socket option `curve_secretkey` from 32-octet binary
622     //  Available from libzmq 4.0.0.
623     void setCurveSecretkeyBin (const byte *curveSecretkey);
624 
625     //  Get socket option `curve_serverkey`.
626     //  Available from libzmq 4.0.0.
627     QString curveServerkey ();
628 
629     //  Set socket option `curve_serverkey`.
630     //  Available from libzmq 4.0.0.
631     void setCurveServerkey (const QString &curveServerkey);
632 
633     //  Set socket option `curve_serverkey` from 32-octet binary
634     //  Available from libzmq 4.0.0.
635     void setCurveServerkeyBin (const byte *curveServerkey);
636 
637     //  Get socket option `gssapi_server`.
638     //  Available from libzmq 4.0.0.
639     int gssapiServer ();
640 
641     //  Set socket option `gssapi_server`.
642     //  Available from libzmq 4.0.0.
643     void setGssapiServer (int gssapiServer);
644 
645     //  Get socket option `gssapi_plaintext`.
646     //  Available from libzmq 4.0.0.
647     int gssapiPlaintext ();
648 
649     //  Set socket option `gssapi_plaintext`.
650     //  Available from libzmq 4.0.0.
651     void setGssapiPlaintext (int gssapiPlaintext);
652 
653     //  Get socket option `gssapi_principal`.
654     //  Available from libzmq 4.0.0.
655     QString gssapiPrincipal ();
656 
657     //  Set socket option `gssapi_principal`.
658     //  Available from libzmq 4.0.0.
659     void setGssapiPrincipal (const QString &gssapiPrincipal);
660 
661     //  Get socket option `gssapi_service_principal`.
662     //  Available from libzmq 4.0.0.
663     QString gssapiServicePrincipal ();
664 
665     //  Set socket option `gssapi_service_principal`.
666     //  Available from libzmq 4.0.0.
667     void setGssapiServicePrincipal (const QString &gssapiServicePrincipal);
668 
669     //  Get socket option `ipv6`.
670     //  Available from libzmq 4.0.0.
671     int ipv6 ();
672 
673     //  Set socket option `ipv6`.
674     //  Available from libzmq 4.0.0.
675     void setIpv6 (int ipv6);
676 
677     //  Get socket option `immediate`.
678     //  Available from libzmq 4.0.0.
679     int immediate ();
680 
681     //  Set socket option `immediate`.
682     //  Available from libzmq 4.0.0.
683     void setImmediate (int immediate);
684 
685     //  Get socket option `sndhwm`.
686     //  Available from libzmq 3.0.0.
687     int sndhwm ();
688 
689     //  Set socket option `sndhwm`.
690     //  Available from libzmq 3.0.0.
691     void setSndhwm (int sndhwm);
692 
693     //  Get socket option `rcvhwm`.
694     //  Available from libzmq 3.0.0.
695     int rcvhwm ();
696 
697     //  Set socket option `rcvhwm`.
698     //  Available from libzmq 3.0.0.
699     void setRcvhwm (int rcvhwm);
700 
701     //  Get socket option `maxmsgsize`.
702     //  Available from libzmq 3.0.0.
703     int maxmsgsize ();
704 
705     //  Set socket option `maxmsgsize`.
706     //  Available from libzmq 3.0.0.
707     void setMaxmsgsize (int maxmsgsize);
708 
709     //  Get socket option `multicast_hops`.
710     //  Available from libzmq 3.0.0.
711     int multicastHops ();
712 
713     //  Set socket option `multicast_hops`.
714     //  Available from libzmq 3.0.0.
715     void setMulticastHops (int multicastHops);
716 
717     //  Set socket option `xpub_verbose`.
718     //  Available from libzmq 3.0.0.
719     void setXpubVerbose (int xpubVerbose);
720 
721     //  Get socket option `tcp_keepalive`.
722     //  Available from libzmq 3.0.0.
723     int tcpKeepalive ();
724 
725     //  Set socket option `tcp_keepalive`.
726     //  Available from libzmq 3.0.0.
727     void setTcpKeepalive (int tcpKeepalive);
728 
729     //  Get socket option `tcp_keepalive_idle`.
730     //  Available from libzmq 3.0.0.
731     int tcpKeepaliveIdle ();
732 
733     //  Set socket option `tcp_keepalive_idle`.
734     //  Available from libzmq 3.0.0.
735     void setTcpKeepaliveIdle (int tcpKeepaliveIdle);
736 
737     //  Get socket option `tcp_keepalive_cnt`.
738     //  Available from libzmq 3.0.0.
739     int tcpKeepaliveCnt ();
740 
741     //  Set socket option `tcp_keepalive_cnt`.
742     //  Available from libzmq 3.0.0.
743     void setTcpKeepaliveCnt (int tcpKeepaliveCnt);
744 
745     //  Get socket option `tcp_keepalive_intvl`.
746     //  Available from libzmq 3.0.0.
747     int tcpKeepaliveIntvl ();
748 
749     //  Set socket option `tcp_keepalive_intvl`.
750     //  Available from libzmq 3.0.0.
751     void setTcpKeepaliveIntvl (int tcpKeepaliveIntvl);
752 
753     //  Get socket option `tcp_accept_filter`.
754     //  Available from libzmq 3.0.0.
755     QString tcpAcceptFilter ();
756 
757     //  Set socket option `tcp_accept_filter`.
758     //  Available from libzmq 3.0.0.
759     void setTcpAcceptFilter (const QString &tcpAcceptFilter);
760 
761     //  Get socket option `last_endpoint`.
762     //  Available from libzmq 3.0.0.
763     QString lastEndpoint ();
764 
765     //  Set socket option `router_raw`.
766     //  Available from libzmq 3.0.0.
767     void setRouterRaw (int routerRaw);
768 
769     //  Get socket option `ipv4only`.
770     //  Available from libzmq 3.0.0.
771     int ipv4only ();
772 
773     //  Set socket option `ipv4only`.
774     //  Available from libzmq 3.0.0.
775     void setIpv4only (int ipv4only);
776 
777     //  Set socket option `delay_attach_on_connect`.
778     //  Available from libzmq 3.0.0.
779     void setDelayAttachOnConnect (int delayAttachOnConnect);
780 
781     //  Get socket option `hwm`.
782     //  Available from libzmq 2.0.0 to 3.0.0.
783     int hwm ();
784 
785     //  Set socket option `hwm`.
786     //  Available from libzmq 2.0.0 to 3.0.0.
787     void setHwm (int hwm);
788 
789     //  Get socket option `swap`.
790     //  Available from libzmq 2.0.0 to 3.0.0.
791     int swap ();
792 
793     //  Set socket option `swap`.
794     //  Available from libzmq 2.0.0 to 3.0.0.
795     void setSwap (int swap);
796 
797     //  Get socket option `affinity`.
798     //  Available from libzmq 2.0.0.
799     int affinity ();
800 
801     //  Set socket option `affinity`.
802     //  Available from libzmq 2.0.0.
803     void setAffinity (int affinity);
804 
805     //  Get socket option `identity`.
806     //  Available from libzmq 2.0.0.
807     QString identity ();
808 
809     //  Set socket option `identity`.
810     //  Available from libzmq 2.0.0.
811     void setIdentity (const QString &identity);
812 
813     //  Get socket option `rate`.
814     //  Available from libzmq 2.0.0.
815     int rate ();
816 
817     //  Set socket option `rate`.
818     //  Available from libzmq 2.0.0.
819     void setRate (int rate);
820 
821     //  Get socket option `recovery_ivl`.
822     //  Available from libzmq 2.0.0.
823     int recoveryIvl ();
824 
825     //  Set socket option `recovery_ivl`.
826     //  Available from libzmq 2.0.0.
827     void setRecoveryIvl (int recoveryIvl);
828 
829     //  Get socket option `recovery_ivl_msec`.
830     //  Available from libzmq 2.0.0 to 3.0.0.
831     int recoveryIvlMsec ();
832 
833     //  Set socket option `recovery_ivl_msec`.
834     //  Available from libzmq 2.0.0 to 3.0.0.
835     void setRecoveryIvlMsec (int recoveryIvlMsec);
836 
837     //  Get socket option `mcast_loop`.
838     //  Available from libzmq 2.0.0 to 3.0.0.
839     int mcastLoop ();
840 
841     //  Set socket option `mcast_loop`.
842     //  Available from libzmq 2.0.0 to 3.0.0.
843     void setMcastLoop (int mcastLoop);
844 
845     //  Get socket option `rcvtimeo`.
846     //  Available from libzmq 2.2.0.
847     int rcvtimeo ();
848 
849     //  Set socket option `rcvtimeo`.
850     //  Available from libzmq 2.2.0.
851     void setRcvtimeo (int rcvtimeo);
852 
853     //  Get socket option `sndtimeo`.
854     //  Available from libzmq 2.2.0.
855     int sndtimeo ();
856 
857     //  Set socket option `sndtimeo`.
858     //  Available from libzmq 2.2.0.
859     void setSndtimeo (int sndtimeo);
860 
861     //  Get socket option `sndbuf`.
862     //  Available from libzmq 2.0.0.
863     int sndbuf ();
864 
865     //  Set socket option `sndbuf`.
866     //  Available from libzmq 2.0.0.
867     void setSndbuf (int sndbuf);
868 
869     //  Get socket option `rcvbuf`.
870     //  Available from libzmq 2.0.0.
871     int rcvbuf ();
872 
873     //  Set socket option `rcvbuf`.
874     //  Available from libzmq 2.0.0.
875     void setRcvbuf (int rcvbuf);
876 
877     //  Get socket option `linger`.
878     //  Available from libzmq 2.0.0.
879     int linger ();
880 
881     //  Set socket option `linger`.
882     //  Available from libzmq 2.0.0.
883     void setLinger (int linger);
884 
885     //  Get socket option `reconnect_ivl`.
886     //  Available from libzmq 2.0.0.
887     int reconnectIvl ();
888 
889     //  Set socket option `reconnect_ivl`.
890     //  Available from libzmq 2.0.0.
891     void setReconnectIvl (int reconnectIvl);
892 
893     //  Get socket option `reconnect_ivl_max`.
894     //  Available from libzmq 2.0.0.
895     int reconnectIvlMax ();
896 
897     //  Set socket option `reconnect_ivl_max`.
898     //  Available from libzmq 2.0.0.
899     void setReconnectIvlMax (int reconnectIvlMax);
900 
901     //  Get socket option `backlog`.
902     //  Available from libzmq 2.0.0.
903     int backlog ();
904 
905     //  Set socket option `backlog`.
906     //  Available from libzmq 2.0.0.
907     void setBacklog (int backlog);
908 
909     //  Set socket option `subscribe`.
910     //  Available from libzmq 2.0.0.
911     void setSubscribe (const QString &subscribe);
912 
913     //  Set socket option `unsubscribe`.
914     //  Available from libzmq 2.0.0.
915     void setUnsubscribe (const QString &unsubscribe);
916 
917     //  Get socket option `type`.
918     //  Available from libzmq 2.0.0.
919     int type ();
920 
921     //  Get socket option `rcvmore`.
922     //  Available from libzmq 2.0.0.
923     int rcvmore ();
924 
925     //  Get socket option `fd`.
926     //  Available from libzmq 2.0.0.
927     SOCKET fd ();
928 
929     //  Get socket option `events`.
930     //  Available from libzmq 2.0.0.
931     int events ();
932 };
933 
934 class QmlZsockAttached : public QObject
935 {
936     Q_OBJECT
937     QObject* m_attached;
938 
939 public:
QmlZsockAttached(QObject * attached)940     QmlZsockAttached (QObject* attached) {
941         Q_UNUSED (attached);
942     };
943 
944 public slots:
945     //  Probe the supplied object, and report if it looks like a zsock_t.
946     //  Takes a polymorphic socket reference.
947     bool is (void *self);
948 
949     //  Probe the supplied reference. If it looks like a zsock_t instance, return
950     //  the underlying libzmq socket handle; else if it looks like a file
951     //  descriptor, return NULL; else if it looks like a libzmq socket handle,
952     //  return the supplied value. Takes a polymorphic socket reference.
953     void *resolve (void *self);
954 
955     //  Self test of this class.
956     void test (bool verbose);
957 
958     //  Create a new socket. Returns the new socket, or NULL if the new socket
959     //  could not be created. Note that the symbol zsock_new (and other
960     //  constructors/destructors for zsock) are redirected to the *_checked
961     //  variant, enabling intelligent socket leak detection. This can have
962     //  performance implications if you use a LOT of sockets. To turn off this
963     //  redirection behaviour, define ZSOCK_NOCHECK.
964     QmlZsock *construct (int type);
965 
966     //  Create a PUB socket. Default action is bind.
967     QmlZsock *constructPub (const QString &endpoint);
968 
969     //  Create a SUB socket, and optionally subscribe to some prefix string. Default
970     //  action is connect.
971     QmlZsock *constructSub (const QString &endpoint, const QString &subscribe);
972 
973     //  Create a REQ socket. Default action is connect.
974     QmlZsock *constructReq (const QString &endpoint);
975 
976     //  Create a REP socket. Default action is bind.
977     QmlZsock *constructRep (const QString &endpoint);
978 
979     //  Create a DEALER socket. Default action is connect.
980     QmlZsock *constructDealer (const QString &endpoint);
981 
982     //  Create a ROUTER socket. Default action is bind.
983     QmlZsock *constructRouter (const QString &endpoint);
984 
985     //  Create a PUSH socket. Default action is connect.
986     QmlZsock *constructPush (const QString &endpoint);
987 
988     //  Create a PULL socket. Default action is bind.
989     QmlZsock *constructPull (const QString &endpoint);
990 
991     //  Create an XPUB socket. Default action is bind.
992     QmlZsock *constructXpub (const QString &endpoint);
993 
994     //  Create an XSUB socket. Default action is connect.
995     QmlZsock *constructXsub (const QString &endpoint);
996 
997     //  Create a PAIR socket. Default action is connect.
998     QmlZsock *constructPair (const QString &endpoint);
999 
1000     //  Create a STREAM socket. Default action is connect.
1001     QmlZsock *constructStream (const QString &endpoint);
1002 
1003     //  Create a SERVER socket. Default action is bind.
1004     QmlZsock *constructServer (const QString &endpoint);
1005 
1006     //  Create a CLIENT socket. Default action is connect.
1007     QmlZsock *constructClient (const QString &endpoint);
1008 
1009     //  Create a RADIO socket. Default action is bind.
1010     QmlZsock *constructRadio (const QString &endpoint);
1011 
1012     //  Create a DISH socket. Default action is connect.
1013     QmlZsock *constructDish (const QString &endpoint);
1014 
1015     //  Create a GATHER socket. Default action is bind.
1016     QmlZsock *constructGather (const QString &endpoint);
1017 
1018     //  Create a SCATTER socket. Default action is connect.
1019     QmlZsock *constructScatter (const QString &endpoint);
1020 
1021     //  Create a DGRAM (UDP) socket. Default action is bind.
1022     //  The endpoint is a string consisting of a
1023     //  'transport'`://` followed by an 'address'. As this is
1024     //  a UDP socket the 'transport' has to be 'udp'. The
1025     //  'address' specifies the ip address and port to
1026     //  bind to. For example:  udp://127.0.0.1:1234
1027     //  Note: To send to an endpoint over UDP you have to
1028     //  send a message with the destination endpoint address
1029     //  as a first message!
1030     QmlZsock *constructDgram (const QString &endpoint);
1031 
1032     //  Destroy the socket. You must use this for any socket created via the
1033     //  zsock_new method.
1034     void destruct (QmlZsock *qmlSelf);
1035 };
1036 
1037 
1038 QML_DECLARE_TYPEINFO(QmlZsock, QML_HAS_ATTACHED_PROPERTIES)
1039 
1040 #endif
1041 /*
1042 ################################################################################
1043 #  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
1044 #  Read the zproject/README.md for information about making permanent changes. #
1045 ################################################################################
1046 */
1047