Types
ZContext = ptr TContext
ZContextOptions = enum IO_THREADS = 1, MAX_SOCKETS = 2, ZMQ_IPV6 = 42
zmq_event_t {.pure, final.} = object event*: uint16 value*: int32
ZMsg {.pure, final.} = object priv*: array[zmq_msg_t_size("4.2.0"), uint8]
ZMsgOptions = enum MORE = 1, SRCFD = 2, SHARED = 3
ZSendRecvOptions = enum NOFLAGS = 0, DONTWAIT = 1, SNDMORE = 2
ZSocket = ptr TSocket
ZSocketType = enum PAIR = 0, PUB = 1, SUB = 2, REQ = 3, REP = 4, DEALER = 5, ROUTER = 6, PULL = 7, PUSH = 8, XPUB = 9, XSUB = 10, STREAM = 11, SERVER = 12, CLIENT = 13
ZSockOptions = enum AFFINITY = 4, IDENTITY = 5, SUBSCRIBE = 6, UNSUBSCRIBE = 7, RATE = 8, RECOVERY_IVL = 9, SNDBUF = 11, RCVBUF = 12, RCVMORE = 13, FD = 14, EVENTS = 15, TYPE = 16, LINGER = 17, RECONNECT_IVL = 18, BACKLOG = 19, RECONNECT_IVL_MAX = 21, MAXMSGSIZE = 22, SNDHWM = 23, RCVHWM = 24, MULTICAST_HOPS = 25, RCVTIMEO = 27, SNDTIMEO = 28, LAST_ENDPOINT = 32, ROUTER_MANDATORY = 33, TCP_KEEPALIVE = 34, TCP_KEEPALIVE_CNT = 35, TCP_KEEPALIVE_IDLE = 36, TCP_KEEPALIVE_INTVL = 37, TCP_ACCEPT_FILTER = 38, IMMEDIATE = 39, XPUB_VERBOSE = 40, ROUTER_RAW = 41, IPV6 = 42, MECHANISM = 43, PLAIN_SERVER = 44, PLAIN_USERNAME = 45, PLAIN_PASSWORD = 46, CURVE_SERVER = 47, CURVE_PUBLICKEY = 48, CURVE_SECRETKEY = 49, CURVE_SERVERKEY = 50, PROBE_ROUTER = 51, REQ_CORRELATE = 52, REQ_RELAXED = 53, CONFLATE = 54, ZAP_DOMAIN = 55, ROUTER_HANDOVER = 56, TOS = 57, CONNECT_RID = 61, GSSAPI_SERVER = 62, GSSAPI_PRINCIPAL = 63, GSSAPI_SERVICE_PRINCIPAL = 64, GSSAPI_PLAINTEXT = 65, HANDSHAKE_IVL = 66, SOCKS_PROXY = 68, XPUB_NODROP = 69, BLOCKY = 70, XPUB_MANUAL = 71, XPUB_WELCOME_MSG = 72, STREAM_NOTIFY = 73, INVERT_MATCHING = 74, HEARTBEAT_IVL = 75, HEARTBEAT_TTL = 76, HEARTBEAT_TIMEOUT = 77, XPUB_VERBOSE_UNSUBSCRIBE = 78, CONNECT_TIMEOUT = 79, TCP_RETRANSMIT_TIMEOUT = 80, THREAD_SAFE = 81
Lets
ZMQ_EAGAIN {.importc: "EAGAIN", header: "errno.h".}: cint
Consts
EADDRINUSE = 156384717
EADDRNOTAVAIL = 156384718
EAFNOSUPPORT = 156384723
ECONNABORTED = 156384725
ECONNREFUSED = 156384719
ECONNRESET = 156384726
EFSM = 156384763
EHOSTUNREACH = 156384729
EINPROGRESS = 156384720
EMSGSIZE = 156384722
EMTHREAD = 156384766
ENETDOWN = 156384716
ENETRESET = 156384730
ENETUNREACH = 156384724
ENOBUFS = 156384715
ENOCOMPATPROTO = 156384764
ENOTCONN = 156384727
ENOTSOCK = 156384721
ENOTSUP = 156384713
EPROTONOSUPPORT = 156384714
ETERM = 156384765
ETIMEDOUT = 156384728
ZMQ_AFFINITY = 4
ZMQ_BACKLOG = 19
ZMQ_BLOCKY = 70
ZMQ_CLIENT = 13
ZMQ_CONFLATE = 54
ZMQ_CONNECT_RID = 61
ZMQ_CONNECT_TIMEOUT = 79
ZMQ_CURVE = 2
ZMQ_CURVE_PUBLICKEY = 48
ZMQ_CURVE_SECRETKEY = 49
ZMQ_CURVE_SERVER = 47
ZMQ_CURVE_SERVERKEY = 50
ZMQ_DEALER = 5
ZMQ_DONTWAIT = 1
ZMQ_EVENT_ACCEPTED = 32
ZMQ_EVENT_ALL = 2047
ZMQ_EVENT_CLOSE_FAILED = 256
ZMQ_EVENT_CLOSED = 128
ZMQ_EVENT_DISCONNECTED = 512
ZMQ_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TER_HANDOVER = 56
ZMQ_ROUTER_MANDATORY = 33
ZMQ_ROUTER_RAW = 41
ZMQ_SERVER = 12
ZMQ_SHARED = 3
ZMQ_SNDBUF = 11
ZMQ_SNDHWM = 23
ZMQ_SNDMORE = 2
ZMQ_SNDTIMEO = 28
ZMQ_SOCKET_LIMIT = 3
ZMQ_SOCKS_PROXY = 68
ZMQ_SRCFD = 2
ZMQ_STREAM = 11
ZMQ_STREAM_NOTIFY = 73
ZMQ_SUB = 2
ZMQ_SUBSCRIBE = 6
ZMQ_TCP_KEEPALIVE = 34
ZMQ_THREAD_SAFE = 81
ZMQ_TOS = 57
ZMQ_TYPE = 16
ZMQ_UNSUBSCRIBE = 7
ZMQ_VERSION = 40200
ZMQ_XPUB = 9
ZMQ_XPUB_MANUAL = 71
ZMQ_XPUB_NODROP = 69
ZMQ_XPUB_VERBOSE = 40
ZMQ_XPUB_WELCOME_MSG = 72
ZMQ_XREP = 6
ZMQ_XREQ = 5
ZMQ_XSUB = 10
ZMQ_ZAP_DOMAIN = 55
zmqdll = "libzmq.so(.4|.5|)"
Procs
proc ctx_destroy(context: ZContext): cint {.cdecl, importc: "zmq_ctx_destroy", dynlib: zmqdll, ...deprecated: "Legacy API. Use ctx_term instead", raises: [], tags: [], forbids: [].}
proc ctx_shutdown(ctx: ZContext): cint {.cdecl, importc: "zmq_ctx_shutdown", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc disconnect(s: ZSocket; address: cstring): cint {.cdecl, importc: "zmq_disconnect", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc errno(): cint {.cdecl, importc: "zmq_errno", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc getsockopt(s: ZSocket; option: ZSockOptions; optval: pointer; optvallen: ptr int): cint {.cdecl, importc: "zmq_getsockopt", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc msg_init(msg: var ZMsg): cint {.cdecl, importc: "zmq_msg_init", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc proxy_steerable(frontend: ZSocket; backend: ZSocket; capture: ZSocket; control: ZSocket): cint {.cdecl, importc: "zmq_proxy_steerable", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc send_const(s: ZSocket; buf: pointer; len: int; flags: cint): cint {.cdecl, importc: "zmq_send_const", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc setsockopt(s: ZSocket; option: ZSockOptions; optval: pointer; optvallen: int): cint {.cdecl, importc: "zmq_setsockopt", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc socket_monitor(s: ZSocket; address: pointer; events: cint): cint {.cdecl, importc: "zmq_socket_monitor", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc strerror(errnum: cint): cstring {.cdecl, importc: "zmq_strerror", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc version(major: var cint; minor: var cint; patch: var cint) {.cdecl, importc: "zmq_version", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc z85_decode(dest: ptr uint8; string: cstring): ptr uint8 {.cdecl, importc: "zmq_z85_decode", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
proc z85_encode(dest: cstring; data: ptr uint8; size: int): cstring {.cdecl, importc: "zmq_z85_encode", dynlib: zmqdll, ...raises: [], tags: [], forbids: [].}
Templates
template ZMQ_MAKE_VERSION(major, minor, patch: untyped): untyped