Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
0
venv/Lib/site-packages/zmq/utils/__init__.py
Normal file
0
venv/Lib/site-packages/zmq/utils/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
venv/Lib/site-packages/zmq/utils/__pycache__/z85.cpython-36.pyc
Normal file
BIN
venv/Lib/site-packages/zmq/utils/__pycache__/z85.cpython-36.pyc
Normal file
Binary file not shown.
313
venv/Lib/site-packages/zmq/utils/buffers.pxd
Normal file
313
venv/Lib/site-packages/zmq/utils/buffers.pxd
Normal file
|
@ -0,0 +1,313 @@
|
|||
"""Python version-independent methods for C/Python buffers.
|
||||
|
||||
This file was copied and adapted from mpi4py.
|
||||
|
||||
Authors
|
||||
-------
|
||||
* MinRK
|
||||
"""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2010 Lisandro Dalcin
|
||||
# All rights reserved.
|
||||
# Used under BSD License: http://www.opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# Retrieval:
|
||||
# Jul 23, 2010 18:00 PST (r539)
|
||||
# http://code.google.com/p/mpi4py/source/browse/trunk/src/MPI/asbuffer.pxi
|
||||
#
|
||||
# Modifications from original:
|
||||
# Copyright (c) 2010-2012 Brian Granger, Min Ragan-Kelley
|
||||
#
|
||||
# Distributed under the terms of the New BSD License. The full license is in
|
||||
# the file COPYING.BSD, distributed as part of this software.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Python includes.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# get version-independent aliases:
|
||||
cdef extern from "pyversion_compat.h":
|
||||
pass
|
||||
|
||||
# Python 3 buffer interface (PEP 3118)
|
||||
cdef extern from "Python.h":
|
||||
int PY_MAJOR_VERSION
|
||||
int PY_MINOR_VERSION
|
||||
ctypedef int Py_ssize_t
|
||||
ctypedef struct PyMemoryViewObject:
|
||||
pass
|
||||
ctypedef struct Py_buffer:
|
||||
void *buf
|
||||
Py_ssize_t len
|
||||
int readonly
|
||||
char *format
|
||||
int ndim
|
||||
Py_ssize_t *shape
|
||||
Py_ssize_t *strides
|
||||
Py_ssize_t *suboffsets
|
||||
Py_ssize_t itemsize
|
||||
void *internal
|
||||
cdef enum:
|
||||
PyBUF_SIMPLE
|
||||
PyBUF_WRITABLE
|
||||
PyBUF_FORMAT
|
||||
PyBUF_ANY_CONTIGUOUS
|
||||
int PyObject_CheckBuffer(object)
|
||||
int PyObject_GetBuffer(object, Py_buffer *, int) except -1
|
||||
void PyBuffer_Release(Py_buffer *)
|
||||
|
||||
int PyBuffer_FillInfo(Py_buffer *view, object obj, void *buf,
|
||||
Py_ssize_t len, int readonly, int infoflags) except -1
|
||||
object PyMemoryView_FromBuffer(Py_buffer *info)
|
||||
|
||||
object PyMemoryView_FromObject(object)
|
||||
|
||||
# Python 2 buffer interface (legacy)
|
||||
cdef extern from "Python.h":
|
||||
Py_ssize_t Py_END_OF_BUFFER
|
||||
int PyObject_CheckReadBuffer(object)
|
||||
int PyObject_AsReadBuffer (object, const void **, Py_ssize_t *) except -1
|
||||
int PyObject_AsWriteBuffer(object, void **, Py_ssize_t *) except -1
|
||||
|
||||
object PyBuffer_FromMemory(void *ptr, Py_ssize_t s)
|
||||
object PyBuffer_FromReadWriteMemory(void *ptr, Py_ssize_t s)
|
||||
|
||||
object PyBuffer_FromObject(object, Py_ssize_t offset, Py_ssize_t size)
|
||||
object PyBuffer_FromReadWriteObject(object, Py_ssize_t offset, Py_ssize_t size)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# asbuffer: C buffer from python object
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
cdef inline int memoryview_available():
|
||||
return PY_MAJOR_VERSION >= 3 or (PY_MAJOR_VERSION >=2 and PY_MINOR_VERSION >= 7)
|
||||
|
||||
cdef inline int oldstyle_available():
|
||||
return PY_MAJOR_VERSION < 3
|
||||
|
||||
|
||||
cdef inline int check_buffer(object ob):
|
||||
"""Version independent check for whether an object is a buffer.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
object : object
|
||||
Any Python object
|
||||
|
||||
Returns
|
||||
-------
|
||||
int : 0 if no buffer interface, 3 if newstyle buffer interface, 2 if oldstyle.
|
||||
"""
|
||||
if PyObject_CheckBuffer(ob):
|
||||
return 3
|
||||
if oldstyle_available():
|
||||
return PyObject_CheckReadBuffer(ob) and 2
|
||||
return 0
|
||||
|
||||
|
||||
cdef inline object asbuffer(object ob, int writable, int format,
|
||||
void **base, Py_ssize_t *size,
|
||||
Py_ssize_t *itemsize):
|
||||
"""Turn an object into a C buffer in a Python version-independent way.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
ob : object
|
||||
The object to be turned into a buffer.
|
||||
Must provide a Python Buffer interface
|
||||
writable : int
|
||||
Whether the resulting buffer should be allowed to write
|
||||
to the object.
|
||||
format : int
|
||||
The format of the buffer. See Python buffer docs.
|
||||
base : void **
|
||||
The pointer that will be used to store the resulting C buffer.
|
||||
size : Py_ssize_t *
|
||||
The size of the buffer(s).
|
||||
itemsize : Py_ssize_t *
|
||||
The size of an item, if the buffer is non-contiguous.
|
||||
|
||||
Returns
|
||||
-------
|
||||
An object describing the buffer format. Generally a str, such as 'B'.
|
||||
"""
|
||||
|
||||
cdef void *bptr = NULL
|
||||
cdef Py_ssize_t blen = 0, bitemlen = 0
|
||||
cdef Py_buffer view
|
||||
cdef int flags = PyBUF_SIMPLE
|
||||
cdef int mode = 0
|
||||
|
||||
bfmt = None
|
||||
|
||||
mode = check_buffer(ob)
|
||||
if mode == 0:
|
||||
raise TypeError("%r does not provide a buffer interface."%ob)
|
||||
|
||||
if mode == 3:
|
||||
flags = PyBUF_ANY_CONTIGUOUS
|
||||
if writable:
|
||||
flags |= PyBUF_WRITABLE
|
||||
if format:
|
||||
flags |= PyBUF_FORMAT
|
||||
PyObject_GetBuffer(ob, &view, flags)
|
||||
bptr = view.buf
|
||||
blen = view.len
|
||||
if format:
|
||||
if view.format != NULL:
|
||||
bfmt = view.format
|
||||
bitemlen = view.itemsize
|
||||
PyBuffer_Release(&view)
|
||||
else: # oldstyle
|
||||
if writable:
|
||||
PyObject_AsWriteBuffer(ob, &bptr, &blen)
|
||||
else:
|
||||
PyObject_AsReadBuffer(ob, <const void **>&bptr, &blen)
|
||||
if format:
|
||||
try: # numpy.ndarray
|
||||
dtype = ob.dtype
|
||||
bfmt = dtype.char
|
||||
bitemlen = dtype.itemsize
|
||||
except AttributeError:
|
||||
try: # array.array
|
||||
bfmt = ob.typecode
|
||||
bitemlen = ob.itemsize
|
||||
except AttributeError:
|
||||
if isinstance(ob, bytes):
|
||||
bfmt = b"B"
|
||||
bitemlen = 1
|
||||
else:
|
||||
# nothing found
|
||||
bfmt = None
|
||||
bitemlen = 0
|
||||
if base: base[0] = <void *>bptr
|
||||
if size: size[0] = <Py_ssize_t>blen
|
||||
if itemsize: itemsize[0] = <Py_ssize_t>bitemlen
|
||||
|
||||
if PY_MAJOR_VERSION >= 3 and bfmt is not None:
|
||||
return bfmt.decode('ascii')
|
||||
return bfmt
|
||||
|
||||
|
||||
cdef inline object asbuffer_r(object ob, void **base, Py_ssize_t *size):
|
||||
"""Wrapper for standard calls to asbuffer with a readonly buffer."""
|
||||
asbuffer(ob, 0, 0, base, size, NULL)
|
||||
return ob
|
||||
|
||||
|
||||
cdef inline object asbuffer_w(object ob, void **base, Py_ssize_t *size):
|
||||
"""Wrapper for standard calls to asbuffer with a writable buffer."""
|
||||
asbuffer(ob, 1, 0, base, size, NULL)
|
||||
return ob
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# frombuffer: python buffer/view from C buffer
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
cdef inline object frombuffer_3(void *ptr, Py_ssize_t s, int readonly):
|
||||
"""Python 3 version of frombuffer.
|
||||
|
||||
This is the Python 3 model, but will work on Python >= 2.6. Currently,
|
||||
we use it only on >= 3.0.
|
||||
"""
|
||||
cdef Py_buffer pybuf
|
||||
cdef Py_ssize_t *shape = [s]
|
||||
cdef str astr=""
|
||||
PyBuffer_FillInfo(&pybuf, astr, ptr, s, readonly, PyBUF_SIMPLE)
|
||||
pybuf.format = "B"
|
||||
pybuf.shape = shape
|
||||
pybuf.ndim = 1
|
||||
return PyMemoryView_FromBuffer(&pybuf)
|
||||
|
||||
|
||||
cdef inline object frombuffer_2(void *ptr, Py_ssize_t s, int readonly):
|
||||
"""Python 2 version of frombuffer.
|
||||
|
||||
This must be used for Python <= 2.6, but we use it for all Python < 3.
|
||||
"""
|
||||
|
||||
if oldstyle_available():
|
||||
if readonly:
|
||||
return PyBuffer_FromMemory(ptr, s)
|
||||
else:
|
||||
return PyBuffer_FromReadWriteMemory(ptr, s)
|
||||
else:
|
||||
raise NotImplementedError("Old style buffers not available.")
|
||||
|
||||
|
||||
cdef inline object frombuffer(void *ptr, Py_ssize_t s, int readonly):
|
||||
"""Create a Python Buffer/View of a C array.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
ptr : void *
|
||||
Pointer to the array to be copied.
|
||||
s : size_t
|
||||
Length of the buffer.
|
||||
readonly : int
|
||||
whether the resulting object should be allowed to write to the buffer.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Python Buffer/View of the C buffer.
|
||||
"""
|
||||
# oldstyle first priority for now
|
||||
if oldstyle_available():
|
||||
return frombuffer_2(ptr, s, readonly)
|
||||
else:
|
||||
return frombuffer_3(ptr, s, readonly)
|
||||
|
||||
|
||||
cdef inline object frombuffer_r(void *ptr, Py_ssize_t s):
|
||||
"""Wrapper for readonly view frombuffer."""
|
||||
return frombuffer(ptr, s, 1)
|
||||
|
||||
|
||||
cdef inline object frombuffer_w(void *ptr, Py_ssize_t s):
|
||||
"""Wrapper for writable view frombuffer."""
|
||||
return frombuffer(ptr, s, 0)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# viewfromobject: python buffer/view from python object, refcounts intact
|
||||
# frombuffer(asbuffer(obj)) would lose track of refs
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cdef inline object viewfromobject(object obj, int readonly):
|
||||
"""Construct a Python Buffer/View object from another Python object.
|
||||
|
||||
This work in a Python version independent manner.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
obj : object
|
||||
The input object to be cast as a buffer
|
||||
readonly : int
|
||||
Whether the result should be prevented from overwriting the original.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Buffer/View of the original object.
|
||||
"""
|
||||
if not memoryview_available():
|
||||
if readonly:
|
||||
return PyBuffer_FromObject(obj, 0, Py_END_OF_BUFFER)
|
||||
else:
|
||||
return PyBuffer_FromReadWriteObject(obj, 0, Py_END_OF_BUFFER)
|
||||
else:
|
||||
return PyMemoryView_FromObject(obj)
|
||||
|
||||
|
||||
cdef inline object viewfromobject_r(object obj):
|
||||
"""Wrapper for readonly viewfromobject."""
|
||||
return viewfromobject(obj, 1)
|
||||
|
||||
|
||||
cdef inline object viewfromobject_w(object obj):
|
||||
"""Wrapper for writable viewfromobject."""
|
||||
return viewfromobject(obj, 0)
|
17
venv/Lib/site-packages/zmq/utils/compiler.json
Normal file
17
venv/Lib/site-packages/zmq/utils/compiler.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"libraries": [
|
||||
"libzmq.cp36-win32",
|
||||
"ws2_32",
|
||||
"iphlpapi",
|
||||
"advapi32"
|
||||
],
|
||||
"library_dirs": [
|
||||
"build\\temp.win32-3.6\\Release\\buildutils"
|
||||
],
|
||||
"include_dirs": [
|
||||
"bundled\\zeromq\\include",
|
||||
"zmq\\utils"
|
||||
],
|
||||
"runtime_library_dirs": [],
|
||||
"define_macros": []
|
||||
}
|
12
venv/Lib/site-packages/zmq/utils/config.json
Normal file
12
venv/Lib/site-packages/zmq/utils/config.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"zmq_prefix": "",
|
||||
"zmq_draft_api": false,
|
||||
"libzmq_extension": true,
|
||||
"no_libzmq_extension": false,
|
||||
"skip_check_zmq": false,
|
||||
"allow_legacy_libzmq": false,
|
||||
"bundle_msvcp": true,
|
||||
"build_ext": {},
|
||||
"bdist_egg": {},
|
||||
"have_sys_un_h": false
|
||||
}
|
550
venv/Lib/site-packages/zmq/utils/constant_names.py
Normal file
550
venv/Lib/site-packages/zmq/utils/constant_names.py
Normal file
|
@ -0,0 +1,550 @@
|
|||
"""0MQ Constant names"""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
# dictionaries of constants new or removed in particular versions
|
||||
|
||||
new_in = {
|
||||
(2,2,0) : [
|
||||
'RCVTIMEO',
|
||||
'SNDTIMEO',
|
||||
],
|
||||
(3,2,2) : [
|
||||
# errnos
|
||||
'EMSGSIZE',
|
||||
'EAFNOSUPPORT',
|
||||
'ENETUNREACH',
|
||||
'ECONNABORTED',
|
||||
'ECONNRESET',
|
||||
'ENOTCONN',
|
||||
'ETIMEDOUT',
|
||||
'EHOSTUNREACH',
|
||||
'ENETRESET',
|
||||
|
||||
# ctx opts
|
||||
'IO_THREADS',
|
||||
'MAX_SOCKETS',
|
||||
'IO_THREADS_DFLT',
|
||||
'MAX_SOCKETS_DFLT',
|
||||
|
||||
# socket opts
|
||||
'IPV4ONLY',
|
||||
'LAST_ENDPOINT',
|
||||
'ROUTER_BEHAVIOR',
|
||||
'ROUTER_MANDATORY',
|
||||
'FAIL_UNROUTABLE',
|
||||
'TCP_KEEPALIVE',
|
||||
'TCP_KEEPALIVE_CNT',
|
||||
'TCP_KEEPALIVE_IDLE',
|
||||
'TCP_KEEPALIVE_INTVL',
|
||||
'DELAY_ATTACH_ON_CONNECT',
|
||||
'XPUB_VERBOSE',
|
||||
|
||||
# msg opts
|
||||
'MORE',
|
||||
|
||||
'EVENT_CONNECTED',
|
||||
'EVENT_CONNECT_DELAYED',
|
||||
'EVENT_CONNECT_RETRIED',
|
||||
'EVENT_LISTENING',
|
||||
'EVENT_BIND_FAILED',
|
||||
'EVENT_ACCEPTED',
|
||||
'EVENT_ACCEPT_FAILED',
|
||||
'EVENT_CLOSED',
|
||||
'EVENT_CLOSE_FAILED',
|
||||
'EVENT_DISCONNECTED',
|
||||
'EVENT_ALL',
|
||||
],
|
||||
(4,0,0) : [
|
||||
# socket types
|
||||
'STREAM',
|
||||
|
||||
# socket opts
|
||||
'IMMEDIATE',
|
||||
'ROUTER_RAW',
|
||||
'IPV6',
|
||||
'MECHANISM',
|
||||
'PLAIN_SERVER',
|
||||
'PLAIN_USERNAME',
|
||||
'PLAIN_PASSWORD',
|
||||
'CURVE_SERVER',
|
||||
'CURVE_PUBLICKEY',
|
||||
'CURVE_SECRETKEY',
|
||||
'CURVE_SERVERKEY',
|
||||
'PROBE_ROUTER',
|
||||
'REQ_RELAXED',
|
||||
'REQ_CORRELATE',
|
||||
'CONFLATE',
|
||||
'ZAP_DOMAIN',
|
||||
|
||||
# security
|
||||
'NULL',
|
||||
'PLAIN',
|
||||
'CURVE',
|
||||
|
||||
# events
|
||||
'EVENT_MONITOR_STOPPED',
|
||||
],
|
||||
(4,1,0) : [
|
||||
# ctx opts
|
||||
'SOCKET_LIMIT',
|
||||
'THREAD_PRIORITY',
|
||||
'THREAD_PRIORITY_DFLT',
|
||||
'THREAD_SCHED_POLICY',
|
||||
'THREAD_SCHED_POLICY_DFLT',
|
||||
|
||||
# socket opts
|
||||
'ROUTER_HANDOVER',
|
||||
'TOS',
|
||||
'IPC_FILTER_PID',
|
||||
'IPC_FILTER_UID',
|
||||
'IPC_FILTER_GID',
|
||||
'CONNECT_RID',
|
||||
'GSSAPI_SERVER',
|
||||
'GSSAPI_PRINCIPAL',
|
||||
'GSSAPI_SERVICE_PRINCIPAL',
|
||||
'GSSAPI_PLAINTEXT',
|
||||
'HANDSHAKE_IVL',
|
||||
'XPUB_NODROP',
|
||||
'SOCKS_PROXY',
|
||||
|
||||
# msg opts
|
||||
'SRCFD',
|
||||
'SHARED',
|
||||
|
||||
# security
|
||||
'GSSAPI',
|
||||
],
|
||||
(4,2,0): [
|
||||
# polling
|
||||
'POLLPRI',
|
||||
],
|
||||
(4,2,3): [
|
||||
'ROUTING_ID',
|
||||
'CONNECT_ROUTING_ID',
|
||||
],
|
||||
(4,3,0): [
|
||||
# context options
|
||||
'MSG_T_SIZE',
|
||||
'THREAD_AFFINITY_CPU_ADD',
|
||||
'THREAD_AFFINITY_CPU_REMOVE',
|
||||
'THREAD_NAME_PREFIX',
|
||||
|
||||
# socket options
|
||||
'GSSAPI_PRINCIPAL_NAMETYPE',
|
||||
'GSSAPI_SERVICE_PRINCIPAL_NAMETYPE',
|
||||
'BINDTODEVICE',
|
||||
|
||||
# GSSAPI principal name types
|
||||
'GSSAPI_NT_HOSTBASED',
|
||||
'GSSAPI_NT_USER_NAME',
|
||||
'GSSAPI_NT_KRB5_PRINCIPAL',
|
||||
|
||||
# events
|
||||
'EVENT_HANDSHAKE_FAILED_NO_DETAIL',
|
||||
'EVENT_HANDSHAKE_SUCCEEDED',
|
||||
'EVENT_HANDSHAKE_FAILED_PROTOCOL',
|
||||
'EVENT_HANDSHAKE_FAILED_AUTH',
|
||||
|
||||
'PROTOCOL_ERROR_ZMTP_UNSPECIFIED',
|
||||
'PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND',
|
||||
'PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE',
|
||||
'PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME',
|
||||
'PROTOCOL_ERROR_ZMTP_INVALID_METADATA',
|
||||
'PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC',
|
||||
'PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH',
|
||||
|
||||
'PROTOCOL_ERROR_ZAP_UNSPECIFIED',
|
||||
'PROTOCOL_ERROR_ZAP_MALFORMED_REPLY',
|
||||
'PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID',
|
||||
'PROTOCOL_ERROR_ZAP_BAD_VERSION',
|
||||
'PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE',
|
||||
'PROTOCOL_ERROR_ZAP_INVALID_METADATA',
|
||||
]
|
||||
}
|
||||
|
||||
draft_in = {
|
||||
(4,2,0): [
|
||||
# socket types
|
||||
'SERVER',
|
||||
'CLIENT',
|
||||
'RADIO',
|
||||
'DISH',
|
||||
'GATHER',
|
||||
'SCATTER',
|
||||
'DGRAM',
|
||||
|
||||
# ctx options
|
||||
'BLOCKY',
|
||||
|
||||
# socket options
|
||||
'XPUB_MANUAL',
|
||||
'XPUB_WELCOME_MSG',
|
||||
'STREAM_NOTIFY',
|
||||
'INVERT_MATCHING',
|
||||
'HEARTBEAT_IVL',
|
||||
'HEARTBEAT_TTL',
|
||||
'HEARTBEAT_TIMEOUT',
|
||||
'XPUB_VERBOSER',
|
||||
'CONNECT_TIMEOUT',
|
||||
'TCP_MAXRT',
|
||||
'THREAD_SAFE',
|
||||
'MULTICAST_MAXTPDU',
|
||||
'VMCI_BUFFER_SIZE',
|
||||
'VMCI_BUFFER_MIN_SIZE',
|
||||
'VMCI_BUFFER_MAX_SIZE',
|
||||
'VMCI_CONNECT_TIMEOUT',
|
||||
'USE_FD',
|
||||
],
|
||||
(4,2,4): [
|
||||
# socket options
|
||||
'ZAP_ENFORCE_DOMAIN',
|
||||
'LOOPBACK_FASTPATH',
|
||||
'METADATA',
|
||||
'ZERO_COPY_RECV',
|
||||
],
|
||||
(4,3,0): [
|
||||
# socket options
|
||||
'ROUTER_NOTIFY',
|
||||
'MULTICAST_LOOP',
|
||||
|
||||
'NOTIFY_CONNECT',
|
||||
'NOTIFY_DISCONNECT',
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
removed_in = {
|
||||
(3,2,2) : [
|
||||
'UPSTREAM',
|
||||
'DOWNSTREAM',
|
||||
|
||||
'HWM',
|
||||
'SWAP',
|
||||
'MCAST_LOOP',
|
||||
'RECOVERY_IVL_MSEC',
|
||||
]
|
||||
}
|
||||
|
||||
# collections of zmq constant names based on their role
|
||||
# base names have no specific use
|
||||
# opt names are validated in get/set methods of various objects
|
||||
|
||||
base_names = [
|
||||
# base
|
||||
'VERSION',
|
||||
'VERSION_MAJOR',
|
||||
'VERSION_MINOR',
|
||||
'VERSION_PATCH',
|
||||
'NOBLOCK',
|
||||
'DONTWAIT',
|
||||
|
||||
'POLLIN',
|
||||
'POLLOUT',
|
||||
'POLLERR',
|
||||
'POLLPRI',
|
||||
|
||||
'SNDMORE',
|
||||
|
||||
'STREAMER',
|
||||
'FORWARDER',
|
||||
'QUEUE',
|
||||
|
||||
'IO_THREADS_DFLT',
|
||||
'MAX_SOCKETS_DFLT',
|
||||
'POLLITEMS_DFLT',
|
||||
'THREAD_PRIORITY_DFLT',
|
||||
'THREAD_SCHED_POLICY_DFLT',
|
||||
|
||||
# socktypes
|
||||
'PAIR',
|
||||
'PUB',
|
||||
'SUB',
|
||||
'REQ',
|
||||
'REP',
|
||||
'DEALER',
|
||||
'ROUTER',
|
||||
'XREQ',
|
||||
'XREP',
|
||||
'PULL',
|
||||
'PUSH',
|
||||
'XPUB',
|
||||
'XSUB',
|
||||
'UPSTREAM',
|
||||
'DOWNSTREAM',
|
||||
'STREAM',
|
||||
'SERVER',
|
||||
'CLIENT',
|
||||
'RADIO',
|
||||
'DISH',
|
||||
'GATHER',
|
||||
'SCATTER',
|
||||
'DGRAM',
|
||||
|
||||
# events
|
||||
'EVENT_CONNECTED',
|
||||
'EVENT_CONNECT_DELAYED',
|
||||
'EVENT_CONNECT_RETRIED',
|
||||
'EVENT_LISTENING',
|
||||
'EVENT_BIND_FAILED',
|
||||
'EVENT_ACCEPTED',
|
||||
'EVENT_ACCEPT_FAILED',
|
||||
'EVENT_CLOSED',
|
||||
'EVENT_CLOSE_FAILED',
|
||||
'EVENT_DISCONNECTED',
|
||||
'EVENT_ALL',
|
||||
'EVENT_MONITOR_STOPPED',
|
||||
'EVENT_HANDSHAKE_FAILED_NO_DETAIL',
|
||||
'EVENT_HANDSHAKE_SUCCEEDED',
|
||||
'EVENT_HANDSHAKE_FAILED_PROTOCOL',
|
||||
'EVENT_HANDSHAKE_FAILED_AUTH',
|
||||
|
||||
'PROTOCOL_ERROR_ZMTP_UNSPECIFIED',
|
||||
'PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND',
|
||||
'PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE',
|
||||
'PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY',
|
||||
'PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME',
|
||||
'PROTOCOL_ERROR_ZMTP_INVALID_METADATA',
|
||||
'PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC',
|
||||
'PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH',
|
||||
|
||||
'PROTOCOL_ERROR_ZAP_UNSPECIFIED',
|
||||
'PROTOCOL_ERROR_ZAP_MALFORMED_REPLY',
|
||||
'PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID',
|
||||
'PROTOCOL_ERROR_ZAP_BAD_VERSION',
|
||||
'PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE',
|
||||
'PROTOCOL_ERROR_ZAP_INVALID_METADATA',
|
||||
|
||||
'NOTIFY_CONNECT',
|
||||
'NOTIFY_DISCONNECT',
|
||||
|
||||
# security
|
||||
'NULL',
|
||||
'PLAIN',
|
||||
'CURVE',
|
||||
'GSSAPI',
|
||||
'GSSAPI_NT_HOSTBASED',
|
||||
'GSSAPI_NT_USER_NAME',
|
||||
'GSSAPI_NT_KRB5_PRINCIPAL',
|
||||
|
||||
## ERRNO
|
||||
# Often used (these are else in errno.)
|
||||
'EAGAIN',
|
||||
'EINVAL',
|
||||
'EFAULT',
|
||||
'ENOMEM',
|
||||
'ENODEV',
|
||||
'EMSGSIZE',
|
||||
'EAFNOSUPPORT',
|
||||
'ENETUNREACH',
|
||||
'ECONNABORTED',
|
||||
'ECONNRESET',
|
||||
'ENOTCONN',
|
||||
'ETIMEDOUT',
|
||||
'EHOSTUNREACH',
|
||||
'ENETRESET',
|
||||
|
||||
# For Windows compatibility
|
||||
'HAUSNUMERO',
|
||||
'ENOTSUP',
|
||||
'EPROTONOSUPPORT',
|
||||
'ENOBUFS',
|
||||
'ENETDOWN',
|
||||
'EADDRINUSE',
|
||||
'EADDRNOTAVAIL',
|
||||
'ECONNREFUSED',
|
||||
'EINPROGRESS',
|
||||
'ENOTSOCK',
|
||||
|
||||
# 0MQ Native
|
||||
'EFSM',
|
||||
'ENOCOMPATPROTO',
|
||||
'ETERM',
|
||||
'EMTHREAD',
|
||||
]
|
||||
|
||||
int64_sockopt_names = [
|
||||
'AFFINITY',
|
||||
'MAXMSGSIZE',
|
||||
|
||||
# sockopts removed in 3.0.0
|
||||
'HWM',
|
||||
'SWAP',
|
||||
'MCAST_LOOP',
|
||||
'RECOVERY_IVL_MSEC',
|
||||
|
||||
# new in 4.2
|
||||
'VMCI_BUFFER_SIZE',
|
||||
'VMCI_BUFFER_MIN_SIZE',
|
||||
'VMCI_BUFFER_MAX_SIZE',
|
||||
]
|
||||
|
||||
bytes_sockopt_names = [
|
||||
'IDENTITY',
|
||||
'SUBSCRIBE',
|
||||
'UNSUBSCRIBE',
|
||||
'LAST_ENDPOINT',
|
||||
'TCP_ACCEPT_FILTER',
|
||||
|
||||
'PLAIN_USERNAME',
|
||||
'PLAIN_PASSWORD',
|
||||
|
||||
'CURVE_PUBLICKEY',
|
||||
'CURVE_SECRETKEY',
|
||||
'CURVE_SERVERKEY',
|
||||
'ZAP_DOMAIN',
|
||||
'CONNECT_RID',
|
||||
'GSSAPI_PRINCIPAL',
|
||||
'GSSAPI_SERVICE_PRINCIPAL',
|
||||
'SOCKS_PROXY',
|
||||
|
||||
'XPUB_WELCOME_MSG',
|
||||
|
||||
# new in 4.2.3
|
||||
'ROUTING_ID',
|
||||
'CONNECT_ROUTING_ID',
|
||||
|
||||
# new in 4.3.0
|
||||
'BINDTODEVICE',
|
||||
]
|
||||
|
||||
fd_sockopt_names = [
|
||||
'FD',
|
||||
]
|
||||
|
||||
int_sockopt_names = [
|
||||
# sockopts
|
||||
'RECONNECT_IVL_MAX',
|
||||
|
||||
# sockopts new in 2.2.0
|
||||
'SNDTIMEO',
|
||||
'RCVTIMEO',
|
||||
|
||||
# new in 3.x
|
||||
'SNDHWM',
|
||||
'RCVHWM',
|
||||
'MULTICAST_HOPS',
|
||||
'IPV4ONLY',
|
||||
|
||||
'ROUTER_BEHAVIOR',
|
||||
'TCP_KEEPALIVE',
|
||||
'TCP_KEEPALIVE_CNT',
|
||||
'TCP_KEEPALIVE_IDLE',
|
||||
'TCP_KEEPALIVE_INTVL',
|
||||
'DELAY_ATTACH_ON_CONNECT',
|
||||
'XPUB_VERBOSE',
|
||||
|
||||
'EVENTS',
|
||||
'TYPE',
|
||||
'LINGER',
|
||||
'RECONNECT_IVL',
|
||||
'BACKLOG',
|
||||
|
||||
'ROUTER_MANDATORY',
|
||||
'FAIL_UNROUTABLE',
|
||||
|
||||
'ROUTER_RAW',
|
||||
'IMMEDIATE',
|
||||
'IPV6',
|
||||
'MECHANISM',
|
||||
'PLAIN_SERVER',
|
||||
'CURVE_SERVER',
|
||||
'PROBE_ROUTER',
|
||||
'REQ_RELAXED',
|
||||
'REQ_CORRELATE',
|
||||
'CONFLATE',
|
||||
'ROUTER_HANDOVER',
|
||||
'TOS',
|
||||
'IPC_FILTER_PID',
|
||||
'IPC_FILTER_UID',
|
||||
'IPC_FILTER_GID',
|
||||
'GSSAPI_SERVER',
|
||||
'GSSAPI_PLAINTEXT',
|
||||
'HANDSHAKE_IVL',
|
||||
'XPUB_NODROP',
|
||||
|
||||
# new in 4.2
|
||||
'XPUB_MANUAL',
|
||||
'STREAM_NOTIFY',
|
||||
'INVERT_MATCHING',
|
||||
'XPUB_VERBOSER',
|
||||
'HEARTBEAT_IVL',
|
||||
'HEARTBEAT_TTL',
|
||||
'HEARTBEAT_TIMEOUT',
|
||||
'CONNECT_TIMEOUT',
|
||||
'TCP_MAXRT',
|
||||
'THREAD_SAFE',
|
||||
'MULTICAST_MAXTPDU',
|
||||
'VMCI_CONNECT_TIMEOUT',
|
||||
'USE_FD',
|
||||
|
||||
# new in 4.3
|
||||
'GSSAPI_PRINCIPAL_NAMETYPE',
|
||||
'GSSAPI_SERVICE_PRINCIPAL_NAMETYPE',
|
||||
'MULTICAST_LOOP',
|
||||
'ROUTER_NOTIFY',
|
||||
'ZAP_ENFORCE_DOMAIN',
|
||||
]
|
||||
|
||||
switched_sockopt_names = [
|
||||
'RATE',
|
||||
'RECOVERY_IVL',
|
||||
'SNDBUF',
|
||||
'RCVBUF',
|
||||
'RCVMORE',
|
||||
]
|
||||
|
||||
ctx_opt_names = [
|
||||
'IO_THREADS',
|
||||
'MAX_SOCKETS',
|
||||
'SOCKET_LIMIT',
|
||||
'THREAD_PRIORITY',
|
||||
'THREAD_SCHED_POLICY',
|
||||
'BLOCKY',
|
||||
|
||||
# new in 4.3
|
||||
'MSG_T_SIZE',
|
||||
'THREAD_AFFINITY_CPU_ADD',
|
||||
'THREAD_AFFINITY_CPU_REMOVE',
|
||||
'THREAD_NAME_PREFIX',
|
||||
]
|
||||
|
||||
msg_opt_names = [
|
||||
'MORE',
|
||||
'SRCFD',
|
||||
'SHARED',
|
||||
]
|
||||
|
||||
from itertools import chain
|
||||
|
||||
all_names = list(chain(
|
||||
base_names,
|
||||
ctx_opt_names,
|
||||
bytes_sockopt_names,
|
||||
fd_sockopt_names,
|
||||
int_sockopt_names,
|
||||
int64_sockopt_names,
|
||||
switched_sockopt_names,
|
||||
msg_opt_names,
|
||||
))
|
||||
|
||||
del chain
|
||||
|
||||
def no_prefix(name):
|
||||
"""does the given constant have a ZMQ_ prefix?"""
|
||||
return name.startswith('E') and not name.startswith('EVENT')
|
||||
|
200
venv/Lib/site-packages/zmq/utils/garbage.py
Normal file
200
venv/Lib/site-packages/zmq/utils/garbage.py
Normal file
|
@ -0,0 +1,200 @@
|
|||
"""Garbage collection thread for representing zmq refcount of Python objects
|
||||
used in zero-copy sends.
|
||||
"""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
|
||||
import atexit
|
||||
import struct
|
||||
|
||||
from os import getpid
|
||||
from collections import namedtuple
|
||||
from threading import Thread, Event, Lock
|
||||
import warnings
|
||||
|
||||
import zmq
|
||||
|
||||
|
||||
gcref = namedtuple('gcref', ['obj', 'event'])
|
||||
|
||||
class GarbageCollectorThread(Thread):
|
||||
"""Thread in which garbage collection actually happens."""
|
||||
def __init__(self, gc):
|
||||
super(GarbageCollectorThread, self).__init__()
|
||||
self.gc = gc
|
||||
self.daemon = True
|
||||
self.pid = getpid()
|
||||
self.ready = Event()
|
||||
|
||||
def run(self):
|
||||
# detect fork at beginning of the thread
|
||||
if getpid is None or getpid() != self.pid:
|
||||
self.ready.set()
|
||||
return
|
||||
try:
|
||||
s = self.gc.context.socket(zmq.PULL)
|
||||
s.linger = 0
|
||||
s.bind(self.gc.url)
|
||||
finally:
|
||||
self.ready.set()
|
||||
|
||||
while True:
|
||||
# detect fork
|
||||
if getpid is None or getpid() != self.pid:
|
||||
return
|
||||
msg = s.recv()
|
||||
if msg == b'DIE':
|
||||
break
|
||||
fmt = 'L' if len(msg) == 4 else 'Q'
|
||||
key = struct.unpack(fmt, msg)[0]
|
||||
tup = self.gc.refs.pop(key, None)
|
||||
if tup and tup.event:
|
||||
tup.event.set()
|
||||
del tup
|
||||
s.close()
|
||||
|
||||
|
||||
class GarbageCollector(object):
|
||||
"""PyZMQ Garbage Collector
|
||||
|
||||
Used for representing the reference held by libzmq during zero-copy sends.
|
||||
This object holds a dictionary, keyed by Python id,
|
||||
of the Python objects whose memory are currently in use by zeromq.
|
||||
|
||||
When zeromq is done with the memory, it sends a message on an inproc PUSH socket
|
||||
containing the packed size_t (32 or 64-bit unsigned int),
|
||||
which is the key in the dict.
|
||||
When the PULL socket in the gc thread receives that message,
|
||||
the reference is popped from the dict,
|
||||
and any tracker events that should be signaled fire.
|
||||
"""
|
||||
|
||||
refs = None
|
||||
_context = None
|
||||
_lock = None
|
||||
url = "inproc://pyzmq.gc.01"
|
||||
|
||||
def __init__(self, context=None):
|
||||
super(GarbageCollector, self).__init__()
|
||||
self.refs = {}
|
||||
self.pid = None
|
||||
self.thread = None
|
||||
self._context = context
|
||||
self._lock = Lock()
|
||||
self._stay_down = False
|
||||
self._push = None
|
||||
self._push_mutex = None
|
||||
atexit.register(self._atexit)
|
||||
|
||||
@property
|
||||
def context(self):
|
||||
if self._context is None:
|
||||
if Thread.__module__.startswith('gevent'):
|
||||
# gevent has monkey-patched Thread, use green Context
|
||||
from zmq import green
|
||||
self._context = green.Context()
|
||||
else:
|
||||
self._context = zmq.Context()
|
||||
return self._context
|
||||
|
||||
@context.setter
|
||||
def context(self, ctx):
|
||||
if self.is_alive():
|
||||
if self.refs:
|
||||
warnings.warn("Replacing gc context while gc is running", RuntimeWarning)
|
||||
self.stop()
|
||||
self._context = ctx
|
||||
|
||||
def _atexit(self):
|
||||
"""atexit callback
|
||||
|
||||
sets _stay_down flag so that gc doesn't try to start up again in other atexit handlers
|
||||
"""
|
||||
self._stay_down = True
|
||||
self.stop()
|
||||
|
||||
def stop(self):
|
||||
"""stop the garbage-collection thread"""
|
||||
if not self.is_alive():
|
||||
return
|
||||
self._stop()
|
||||
|
||||
def _stop(self):
|
||||
push = self.context.socket(zmq.PUSH)
|
||||
push.connect(self.url)
|
||||
push.send(b'DIE')
|
||||
push.close()
|
||||
if self._push:
|
||||
self._push.close()
|
||||
self._push = None
|
||||
self._push_mutex = None
|
||||
self.thread.join()
|
||||
self.context.term()
|
||||
self.refs.clear()
|
||||
self.context = None
|
||||
|
||||
@property
|
||||
def _push_socket(self):
|
||||
"""The PUSH socket for use in the zmq message destructor callback.
|
||||
"""
|
||||
if not self.is_alive() or self._push is None:
|
||||
self._push = self.context.socket(zmq.PUSH)
|
||||
self._push.connect(self.url)
|
||||
return self._push
|
||||
|
||||
def start(self):
|
||||
"""Start a new garbage collection thread.
|
||||
|
||||
Creates a new zmq Context used for garbage collection.
|
||||
Under most circumstances, this will only be called once per process.
|
||||
"""
|
||||
if self.thread is not None and self.pid != getpid():
|
||||
# It's re-starting, must free earlier thread's context
|
||||
# since a fork probably broke it
|
||||
self._stop()
|
||||
self.pid = getpid()
|
||||
self.refs = {}
|
||||
self.thread = GarbageCollectorThread(self)
|
||||
self.thread.start()
|
||||
self.thread.ready.wait()
|
||||
|
||||
def is_alive(self):
|
||||
"""Is the garbage collection thread currently running?
|
||||
|
||||
Includes checks for process shutdown or fork.
|
||||
"""
|
||||
if (getpid is None or
|
||||
getpid() != self.pid or
|
||||
self.thread is None or
|
||||
not self.thread.is_alive()
|
||||
):
|
||||
return False
|
||||
return True
|
||||
|
||||
def store(self, obj, event=None):
|
||||
"""store an object and (optionally) event for zero-copy"""
|
||||
if not self.is_alive():
|
||||
if self._stay_down:
|
||||
return 0
|
||||
# safely start the gc thread
|
||||
# use lock and double check,
|
||||
# so we don't start multiple threads
|
||||
with self._lock:
|
||||
if not self.is_alive():
|
||||
self.start()
|
||||
tup = gcref(obj, event)
|
||||
theid = id(tup)
|
||||
self.refs[theid] = tup
|
||||
return theid
|
||||
|
||||
def __del__(self):
|
||||
if not self.is_alive():
|
||||
return
|
||||
try:
|
||||
self.stop()
|
||||
except Exception as e:
|
||||
raise (e)
|
||||
|
||||
gc = GarbageCollector()
|
6
venv/Lib/site-packages/zmq/utils/getpid_compat.h
Normal file
6
venv/Lib/site-packages/zmq/utils/getpid_compat.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
#define getpid _getpid
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
33
venv/Lib/site-packages/zmq/utils/interop.py
Normal file
33
venv/Lib/site-packages/zmq/utils/interop.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
"""Utils for interoperability with other libraries.
|
||||
|
||||
Just CFFI pointer casting for now.
|
||||
"""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
|
||||
try:
|
||||
long
|
||||
except NameError:
|
||||
long = int # Python 3
|
||||
|
||||
|
||||
def cast_int_addr(n):
|
||||
"""Cast an address to a Python int
|
||||
|
||||
This could be a Python integer or a CFFI pointer
|
||||
"""
|
||||
if isinstance(n, (int, long)):
|
||||
return n
|
||||
try:
|
||||
import cffi
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
# from pyzmq, this is an FFI void *
|
||||
ffi = cffi.FFI()
|
||||
if isinstance(n, ffi.CData):
|
||||
return int(ffi.cast("size_t", n))
|
||||
|
||||
raise ValueError("Cannot cast %r to int" % n)
|
21
venv/Lib/site-packages/zmq/utils/ipcmaxlen.h
Normal file
21
venv/Lib/site-packages/zmq/utils/ipcmaxlen.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
|
||||
Platform-independant detection of IPC path max length
|
||||
|
||||
Copyright (c) 2012 Godefroid Chapelle
|
||||
|
||||
Distributed under the terms of the New BSD License. The full license is in
|
||||
the file COPYING.BSD, distributed as part of this software.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_SYS_UN_H)
|
||||
#include "sys/un.h"
|
||||
int get_ipc_path_max_len(void) {
|
||||
struct sockaddr_un *dummy;
|
||||
return sizeof(dummy->sun_path) - 1;
|
||||
}
|
||||
#else
|
||||
int get_ipc_path_max_len(void) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
59
venv/Lib/site-packages/zmq/utils/jsonapi.py
Normal file
59
venv/Lib/site-packages/zmq/utils/jsonapi.py
Normal file
|
@ -0,0 +1,59 @@
|
|||
"""Priority based json library imports.
|
||||
|
||||
Always serializes to bytes instead of unicode for zeromq compatibility
|
||||
on Python 2 and 3.
|
||||
|
||||
Use ``jsonapi.loads()`` and ``jsonapi.dumps()`` for guaranteed symmetry.
|
||||
|
||||
Priority: ``simplejson`` > ``jsonlib2`` > stdlib ``json``
|
||||
|
||||
``jsonapi.loads/dumps`` provide kwarg-compatibility with stdlib json.
|
||||
|
||||
``jsonapi.jsonmod`` will be the module of the actual underlying implementation.
|
||||
"""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
from zmq.utils.strtypes import bytes, unicode
|
||||
|
||||
jsonmod = None
|
||||
|
||||
priority = ['simplejson', 'jsonlib2', 'json']
|
||||
for mod in priority:
|
||||
try:
|
||||
jsonmod = __import__(mod)
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
break
|
||||
|
||||
def dumps(o, **kwargs):
|
||||
"""Serialize object to JSON bytes (utf-8).
|
||||
|
||||
See jsonapi.jsonmod.dumps for details on kwargs.
|
||||
"""
|
||||
|
||||
if 'separators' not in kwargs:
|
||||
kwargs['separators'] = (',', ':')
|
||||
|
||||
s = jsonmod.dumps(o, **kwargs)
|
||||
|
||||
if isinstance(s, unicode):
|
||||
s = s.encode('utf8')
|
||||
|
||||
return s
|
||||
|
||||
def loads(s, **kwargs):
|
||||
"""Load object from JSON bytes (utf-8).
|
||||
|
||||
See jsonapi.jsonmod.loads for details on kwargs.
|
||||
"""
|
||||
|
||||
if str is unicode and isinstance(s, bytes):
|
||||
s = s.decode('utf8')
|
||||
|
||||
return jsonmod.loads(s, **kwargs)
|
||||
|
||||
__all__ = ['jsonmod', 'dumps', 'loads']
|
||||
|
68
venv/Lib/site-packages/zmq/utils/monitor.py
Normal file
68
venv/Lib/site-packages/zmq/utils/monitor.py
Normal file
|
@ -0,0 +1,68 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Module holding utility and convenience functions for zmq event monitoring."""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import struct
|
||||
import zmq
|
||||
from zmq.error import _check_version
|
||||
|
||||
def parse_monitor_message(msg):
|
||||
"""decode zmq_monitor event messages.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
msg : list(bytes)
|
||||
zmq multipart message that has arrived on a monitor PAIR socket.
|
||||
|
||||
First frame is::
|
||||
|
||||
16 bit event id
|
||||
32 bit event value
|
||||
no padding
|
||||
|
||||
Second frame is the endpoint as a bytestring
|
||||
|
||||
Returns
|
||||
-------
|
||||
event : dict
|
||||
event description as dict with the keys `event`, `value`, and `endpoint`.
|
||||
"""
|
||||
|
||||
if len(msg) != 2 or len(msg[0]) != 6:
|
||||
raise RuntimeError("Invalid event message format: %s" % msg)
|
||||
event = {'event': struct.unpack("=hi", msg[0])[0],
|
||||
'value': struct.unpack("=hi", msg[0])[1],
|
||||
'endpoint': msg[1]}
|
||||
return event
|
||||
|
||||
def recv_monitor_message(socket, flags=0):
|
||||
"""Receive and decode the given raw message from the monitoring socket and return a dict.
|
||||
|
||||
Requires libzmq ≥ 4.0
|
||||
|
||||
The returned dict will have the following entries:
|
||||
event : int, the event id as described in libzmq.zmq_socket_monitor
|
||||
value : int, the event value associated with the event, see libzmq.zmq_socket_monitor
|
||||
endpoint : string, the affected endpoint
|
||||
|
||||
Parameters
|
||||
----------
|
||||
socket : zmq PAIR socket
|
||||
The PAIR socket (created by other.get_monitor_socket()) on which to recv the message
|
||||
flags : bitfield (int)
|
||||
standard zmq recv flags
|
||||
|
||||
Returns
|
||||
-------
|
||||
event : dict
|
||||
event description as dict with the keys `event`, `value`, and `endpoint`.
|
||||
"""
|
||||
_check_version((4,0), 'libzmq event API')
|
||||
# will always return a list
|
||||
msg = socket.recv_multipart(flags)
|
||||
# 4.0-style event API
|
||||
return parse_monitor_message(msg)
|
||||
|
||||
__all__ = ['parse_monitor_message', 'recv_monitor_message']
|
82
venv/Lib/site-packages/zmq/utils/mutex.h
Normal file
82
venv/Lib/site-packages/zmq/utils/mutex.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* simplified from mutex.c from Foundation Library, in the Public Domain
|
||||
* https://github.com/rampantpixels/foundation_lib/blob/master/foundation/mutex.c
|
||||
*
|
||||
* This file is Copyright (C) PyZMQ Developers
|
||||
* Distributed under the terms of the Modified BSD License.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_WIN32)
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
#if defined(_WIN32)
|
||||
CRITICAL_SECTION csection;
|
||||
#else
|
||||
pthread_mutex_t mutex;
|
||||
#endif
|
||||
} mutex_t;
|
||||
|
||||
|
||||
static void
|
||||
_mutex_initialize(mutex_t* mutex) {
|
||||
#if defined(_WIN32)
|
||||
InitializeCriticalSectionAndSpinCount(&mutex->csection, 4000);
|
||||
#else
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
pthread_mutex_init(&mutex->mutex, &attr);
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
_mutex_finalize(mutex_t* mutex) {
|
||||
#if defined(_WIN32)
|
||||
DeleteCriticalSection(&mutex->csection);
|
||||
#else
|
||||
pthread_mutex_destroy(&mutex->mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
mutex_t*
|
||||
mutex_allocate(void) {
|
||||
mutex_t* mutex = (mutex_t*)malloc(sizeof(mutex_t));
|
||||
_mutex_initialize(mutex);
|
||||
return mutex;
|
||||
}
|
||||
|
||||
void
|
||||
mutex_deallocate(mutex_t* mutex) {
|
||||
if (!mutex)
|
||||
return;
|
||||
_mutex_finalize(mutex);
|
||||
free(mutex);
|
||||
}
|
||||
|
||||
int
|
||||
mutex_lock(mutex_t* mutex) {
|
||||
#if defined(_WIN32)
|
||||
EnterCriticalSection(&mutex->csection);
|
||||
return 0;
|
||||
#else
|
||||
return pthread_mutex_lock(&mutex->mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
mutex_unlock(mutex_t* mutex) {
|
||||
#if defined(_WIN32)
|
||||
LeaveCriticalSection(&mutex->csection);
|
||||
return 0;
|
||||
#else
|
||||
return pthread_mutex_unlock(&mutex->mutex);
|
||||
#endif
|
||||
}
|
25
venv/Lib/site-packages/zmq/utils/pyversion_compat.h
Normal file
25
venv/Lib/site-packages/zmq/utils/pyversion_compat.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "Python.h"
|
||||
|
||||
#if PY_VERSION_HEX < 0x02070000
|
||||
#define PyMemoryView_FromBuffer(info) (PyErr_SetString(PyExc_NotImplementedError, \
|
||||
"new buffer interface is not available"), (PyObject *)NULL)
|
||||
#define PyMemoryView_FromObject(object) (PyErr_SetString(PyExc_NotImplementedError, \
|
||||
"new buffer interface is not available"), (PyObject *)NULL)
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
// for buffers
|
||||
#define Py_END_OF_BUFFER ((Py_ssize_t) 0)
|
||||
|
||||
#define PyObject_CheckReadBuffer(object) (0)
|
||||
|
||||
#define PyBuffer_FromMemory(ptr, s) (PyErr_SetString(PyExc_NotImplementedError, \
|
||||
"old buffer interface is not available"), (PyObject *)NULL)
|
||||
#define PyBuffer_FromReadWriteMemory(ptr, s) (PyErr_SetString(PyExc_NotImplementedError, \
|
||||
"old buffer interface is not available"), (PyObject *)NULL)
|
||||
#define PyBuffer_FromObject(object, offset, size) (PyErr_SetString(PyExc_NotImplementedError, \
|
||||
"old buffer interface is not available"), (PyObject *)NULL)
|
||||
#define PyBuffer_FromReadWriteObject(object, offset, size) (PyErr_SetString(PyExc_NotImplementedError, \
|
||||
"old buffer interface is not available"), (PyObject *)NULL)
|
||||
|
||||
#endif
|
52
venv/Lib/site-packages/zmq/utils/sixcerpt.py
Normal file
52
venv/Lib/site-packages/zmq/utils/sixcerpt.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
"""Excerpts of six.py"""
|
||||
|
||||
# Copyright (C) 2010-2014 Benjamin Peterson
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
import sys
|
||||
|
||||
# Useful for very coarse version differentiation.
|
||||
PY2 = sys.version_info[0] == 2
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
if PY3:
|
||||
|
||||
def reraise(tp, value, tb=None):
|
||||
if value.__traceback__ is not tb:
|
||||
raise value.with_traceback(tb)
|
||||
raise value
|
||||
|
||||
else:
|
||||
def exec_(_code_, _globs_=None, _locs_=None):
|
||||
"""Execute code in a namespace."""
|
||||
if _globs_ is None:
|
||||
frame = sys._getframe(1)
|
||||
_globs_ = frame.f_globals
|
||||
if _locs_ is None:
|
||||
_locs_ = frame.f_locals
|
||||
del frame
|
||||
elif _locs_ is None:
|
||||
_locs_ = _globs_
|
||||
exec("""exec _code_ in _globs_, _locs_""")
|
||||
|
||||
|
||||
exec_("""def reraise(tp, value, tb=None):
|
||||
raise tp, value, tb
|
||||
""")
|
45
venv/Lib/site-packages/zmq/utils/strtypes.py
Normal file
45
venv/Lib/site-packages/zmq/utils/strtypes.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
"""Declare basic string types unambiguously for various Python versions.
|
||||
|
||||
Authors
|
||||
-------
|
||||
* MinRK
|
||||
"""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
bytes = bytes
|
||||
unicode = str
|
||||
basestring = (bytes, unicode)
|
||||
else:
|
||||
unicode = unicode
|
||||
bytes = str
|
||||
basestring = basestring
|
||||
|
||||
def cast_bytes(s, encoding='utf8', errors='strict'):
|
||||
"""cast unicode or bytes to bytes"""
|
||||
if isinstance(s, bytes):
|
||||
return s
|
||||
elif isinstance(s, unicode):
|
||||
return s.encode(encoding, errors)
|
||||
else:
|
||||
raise TypeError("Expected unicode or bytes, got %r" % s)
|
||||
|
||||
def cast_unicode(s, encoding='utf8', errors='strict'):
|
||||
"""cast bytes or unicode to unicode"""
|
||||
if isinstance(s, bytes):
|
||||
return s.decode(encoding, errors)
|
||||
elif isinstance(s, unicode):
|
||||
return s
|
||||
else:
|
||||
raise TypeError("Expected unicode or bytes, got %r" % s)
|
||||
|
||||
# give short 'b' alias for cast_bytes, so that we can use fake b('stuff')
|
||||
# to simulate b'stuff'
|
||||
b = asbytes = cast_bytes
|
||||
u = cast_unicode
|
||||
|
||||
__all__ = ['asbytes', 'bytes', 'unicode', 'basestring', 'b', 'u', 'cast_bytes', 'cast_unicode']
|
132
venv/Lib/site-packages/zmq/utils/win32.py
Normal file
132
venv/Lib/site-packages/zmq/utils/win32.py
Normal file
|
@ -0,0 +1,132 @@
|
|||
"""Win32 compatibility utilities."""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
|
||||
# No-op implementation for other platforms.
|
||||
class _allow_interrupt(object):
|
||||
"""Utility for fixing CTRL-C events on Windows.
|
||||
|
||||
On Windows, the Python interpreter intercepts CTRL-C events in order to
|
||||
translate them into ``KeyboardInterrupt`` exceptions. It (presumably)
|
||||
does this by setting a flag in its "console control handler" and
|
||||
checking it later at a convenient location in the interpreter.
|
||||
|
||||
However, when the Python interpreter is blocked waiting for the ZMQ
|
||||
poll operation to complete, it must wait for ZMQ's ``select()``
|
||||
operation to complete before translating the CTRL-C event into the
|
||||
``KeyboardInterrupt`` exception.
|
||||
|
||||
The only way to fix this seems to be to add our own "console control
|
||||
handler" and perform some application-defined operation that will
|
||||
unblock the ZMQ polling operation in order to force ZMQ to pass control
|
||||
back to the Python interpreter.
|
||||
|
||||
This context manager performs all that Windows-y stuff, providing you
|
||||
with a hook that is called when a CTRL-C event is intercepted. This
|
||||
hook allows you to unblock your ZMQ poll operation immediately, which
|
||||
will then result in the expected ``KeyboardInterrupt`` exception.
|
||||
|
||||
Without this context manager, your ZMQ-based application will not
|
||||
respond normally to CTRL-C events on Windows. If a CTRL-C event occurs
|
||||
while blocked on ZMQ socket polling, the translation to a
|
||||
``KeyboardInterrupt`` exception will be delayed until the I/O completes
|
||||
and control returns to the Python interpreter (this may never happen if
|
||||
you use an infinite timeout).
|
||||
|
||||
A no-op implementation is provided on non-Win32 systems to avoid the
|
||||
application from having to conditionally use it.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
def stop_my_application():
|
||||
# ...
|
||||
|
||||
with allow_interrupt(stop_my_application):
|
||||
# main polling loop.
|
||||
|
||||
In a typical ZMQ application, you would use the "self pipe trick" to
|
||||
send message to a ``PAIR`` socket in order to interrupt your blocking
|
||||
socket polling operation.
|
||||
|
||||
In a Tornado event loop, you can use the ``IOLoop.stop`` method to
|
||||
unblock your I/O loop.
|
||||
"""
|
||||
|
||||
def __init__(self, action=None):
|
||||
"""Translate ``action`` into a CTRL-C handler.
|
||||
|
||||
``action`` is a callable that takes no arguments and returns no
|
||||
value (returned value is ignored). It must *NEVER* raise an
|
||||
exception.
|
||||
|
||||
If unspecified, a no-op will be used.
|
||||
"""
|
||||
self._init_action(action)
|
||||
|
||||
def _init_action(self, action):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
return
|
||||
|
||||
if os.name == 'nt':
|
||||
from ctypes import WINFUNCTYPE, windll
|
||||
from ctypes.wintypes import BOOL, DWORD
|
||||
|
||||
kernel32 = windll.LoadLibrary('kernel32')
|
||||
|
||||
# <http://msdn.microsoft.com/en-us/library/ms686016.aspx>
|
||||
PHANDLER_ROUTINE = WINFUNCTYPE(BOOL, DWORD)
|
||||
SetConsoleCtrlHandler = kernel32.SetConsoleCtrlHandler
|
||||
SetConsoleCtrlHandler.argtypes = (PHANDLER_ROUTINE, BOOL)
|
||||
SetConsoleCtrlHandler.restype = BOOL
|
||||
|
||||
class allow_interrupt(_allow_interrupt):
|
||||
__doc__ = _allow_interrupt.__doc__
|
||||
|
||||
def _init_action(self, action):
|
||||
if action is None:
|
||||
action = lambda: None
|
||||
self.action = action
|
||||
@PHANDLER_ROUTINE
|
||||
def handle(event):
|
||||
if event == 0: # CTRL_C_EVENT
|
||||
action()
|
||||
# Typical C implementations would return 1 to indicate that
|
||||
# the event was processed and other control handlers in the
|
||||
# stack should not be executed. However, that would
|
||||
# prevent the Python interpreter's handler from translating
|
||||
# CTRL-C to a `KeyboardInterrupt` exception, so we pretend
|
||||
# that we didn't handle it.
|
||||
return 0
|
||||
self.handle = handle
|
||||
|
||||
def __enter__(self):
|
||||
"""Install the custom CTRL-C handler."""
|
||||
result = SetConsoleCtrlHandler(self.handle, 1)
|
||||
if result == 0:
|
||||
# Have standard library automatically call `GetLastError()` and
|
||||
# `FormatMessage()` into a nice exception object :-)
|
||||
raise WindowsError()
|
||||
|
||||
def __exit__(self, *args):
|
||||
"""Remove the custom CTRL-C handler."""
|
||||
result = SetConsoleCtrlHandler(self.handle, 0)
|
||||
if result == 0:
|
||||
# Have standard library automatically call `GetLastError()` and
|
||||
# `FormatMessage()` into a nice exception object :-)
|
||||
raise WindowsError()
|
||||
else:
|
||||
class allow_interrupt(_allow_interrupt):
|
||||
__doc__ = _allow_interrupt.__doc__
|
||||
pass
|
62
venv/Lib/site-packages/zmq/utils/z85.py
Normal file
62
venv/Lib/site-packages/zmq/utils/z85.py
Normal file
|
@ -0,0 +1,62 @@
|
|||
"""Python implementation of Z85 85-bit encoding
|
||||
|
||||
Z85 encoding is a plaintext encoding for a bytestring interpreted as 32bit integers.
|
||||
Since the chunks are 32bit, a bytestring must be a multiple of 4 bytes.
|
||||
See ZMQ RFC 32 for details.
|
||||
|
||||
|
||||
"""
|
||||
|
||||
# Copyright (C) PyZMQ Developers
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import sys
|
||||
import struct
|
||||
|
||||
PY3 = sys.version_info[0] >= 3
|
||||
# Z85CHARS is the base 85 symbol table
|
||||
Z85CHARS = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#"
|
||||
# Z85MAP maps integers in [0,84] to the appropriate character in Z85CHARS
|
||||
Z85MAP = dict([(c, idx) for idx, c in enumerate(Z85CHARS)])
|
||||
|
||||
_85s = [ 85**i for i in range(5) ][::-1]
|
||||
|
||||
def encode(rawbytes):
|
||||
"""encode raw bytes into Z85"""
|
||||
# Accepts only byte arrays bounded to 4 bytes
|
||||
if len(rawbytes) % 4:
|
||||
raise ValueError("length must be multiple of 4, not %i" % len(rawbytes))
|
||||
|
||||
nvalues = len(rawbytes) / 4
|
||||
|
||||
values = struct.unpack('>%dI' % nvalues, rawbytes)
|
||||
encoded = []
|
||||
for v in values:
|
||||
for offset in _85s:
|
||||
encoded.append(Z85CHARS[(v // offset) % 85])
|
||||
|
||||
# In Python 3, encoded is a list of integers (obviously?!)
|
||||
if PY3:
|
||||
return bytes(encoded)
|
||||
else:
|
||||
return b''.join(encoded)
|
||||
|
||||
def decode(z85bytes):
|
||||
"""decode Z85 bytes to raw bytes, accepts ASCII string"""
|
||||
if PY3 and isinstance(z85bytes, str):
|
||||
try:
|
||||
z85bytes = z85bytes.encode('ascii')
|
||||
except UnicodeEncodeError:
|
||||
raise ValueError('string argument should contain only ASCII characters')
|
||||
|
||||
if len(z85bytes) % 5:
|
||||
raise ValueError("Z85 length must be multiple of 5, not %i" % len(z85bytes))
|
||||
|
||||
nvalues = len(z85bytes) / 5
|
||||
values = []
|
||||
for i in range(0, len(z85bytes), 5):
|
||||
value = 0
|
||||
for j, offset in enumerate(_85s):
|
||||
value += Z85MAP[z85bytes[i+j]] * offset
|
||||
values.append(value)
|
||||
return struct.pack('>%dI' % nvalues, *values)
|
110
venv/Lib/site-packages/zmq/utils/zmq_compat.h
Normal file
110
venv/Lib/site-packages/zmq/utils/zmq_compat.h
Normal file
|
@ -0,0 +1,110 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (c) 2010 Brian Granger, Min Ragan-Kelley
|
||||
//
|
||||
// Distributed under the terms of the New BSD License. The full license is in
|
||||
// the file COPYING.BSD, distributed as part of this software.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define pyzmq_int64_t __int64
|
||||
#define pyzmq_uint32_t unsigned __int32
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#define pyzmq_int64_t int64_t
|
||||
#define pyzmq_uint32_t uint32_t
|
||||
#endif
|
||||
|
||||
|
||||
#include "zmq.h"
|
||||
// version compatibility for constants:
|
||||
#include "zmq_constants.h"
|
||||
|
||||
#define _missing (-1)
|
||||
|
||||
|
||||
// define fd type (from libzmq's fd.hpp)
|
||||
#ifdef _WIN32
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1400
|
||||
#define ZMQ_FD_T UINT_PTR
|
||||
#else
|
||||
#define ZMQ_FD_T SOCKET
|
||||
#endif
|
||||
#else
|
||||
#define ZMQ_FD_T int
|
||||
#endif
|
||||
|
||||
#if ZMQ_VERSION_MAJOR >= 4 && ZMQ_VERSION_MINOR >= 2
|
||||
// Nothing to remove
|
||||
#else
|
||||
#define zmq_curve_public(z85_public_key, z85_secret_key) _missing
|
||||
#endif
|
||||
|
||||
// use unambiguous aliases for zmq_send/recv functions
|
||||
|
||||
#if ZMQ_VERSION_MAJOR >= 4
|
||||
// nothing to remove
|
||||
#if ZMQ_VERSION_MINOR == 0
|
||||
// zmq 4.1 deprecates zmq_utils.h
|
||||
// we only get zmq_curve_keypair from it
|
||||
#include "zmq_utils.h"
|
||||
#endif
|
||||
#else
|
||||
#define zmq_curve_keypair(z85_public_key, z85_secret_key) _missing
|
||||
#endif
|
||||
|
||||
// libzmq 4.2 draft API
|
||||
#ifdef ZMQ_BUILD_DRAFT_API
|
||||
#if ZMQ_VERSION_MAJOR >= 4 && ZMQ_VERSION_MINOR >= 2
|
||||
#define PYZMQ_DRAFT_42
|
||||
#endif
|
||||
#endif
|
||||
#ifndef PYZMQ_DRAFT_42
|
||||
#define zmq_join(s, group) _missing
|
||||
#define zmq_leave(s, group) _missing
|
||||
#define zmq_msg_set_routing_id(msg, routing_id) _missing
|
||||
#define zmq_msg_routing_id(msg) 0
|
||||
#define zmq_msg_set_group(msg, group) _missing
|
||||
#define zmq_msg_group(msg) NULL
|
||||
#endif
|
||||
|
||||
#if ZMQ_VERSION_MAJOR >= 4 && ZMQ_VERSION_MINOR >= 1
|
||||
// nothing to remove
|
||||
#else
|
||||
#define zmq_msg_gets(msg, prop) _missing
|
||||
#define zmq_has(capability) _missing
|
||||
#define zmq_proxy_steerable(in, out, mon, ctrl) _missing
|
||||
#endif
|
||||
|
||||
#if ZMQ_VERSION_MAJOR >= 3
|
||||
#define zmq_sendbuf zmq_send
|
||||
#define zmq_recvbuf zmq_recv
|
||||
|
||||
// 3.x deprecations - these symbols haven't been removed,
|
||||
// but let's protect against their planned removal
|
||||
#define zmq_device(device_type, isocket, osocket) _missing
|
||||
#define zmq_init(io_threads) ((void*)NULL)
|
||||
#define zmq_term zmq_ctx_destroy
|
||||
#else
|
||||
#define zmq_ctx_set(ctx, opt, val) _missing
|
||||
#define zmq_ctx_get(ctx, opt) _missing
|
||||
#define zmq_ctx_destroy zmq_term
|
||||
#define zmq_ctx_new() ((void*)NULL)
|
||||
|
||||
#define zmq_proxy(a,b,c) _missing
|
||||
|
||||
#define zmq_disconnect(s, addr) _missing
|
||||
#define zmq_unbind(s, addr) _missing
|
||||
|
||||
#define zmq_msg_more(msg) _missing
|
||||
#define zmq_msg_get(msg, opt) _missing
|
||||
#define zmq_msg_set(msg, opt, val) _missing
|
||||
#define zmq_msg_send(msg, s, flags) zmq_send(s, msg, flags)
|
||||
#define zmq_msg_recv(msg, s, flags) zmq_recv(s, msg, flags)
|
||||
|
||||
#define zmq_sendbuf(s, buf, len, flags) _missing
|
||||
#define zmq_recvbuf(s, buf, len, flags) _missing
|
||||
|
||||
#define zmq_socket_monitor(s, addr, flags) _missing
|
||||
|
||||
#endif
|
||||
|
893
venv/Lib/site-packages/zmq/utils/zmq_constants.h
Normal file
893
venv/Lib/site-packages/zmq/utils/zmq_constants.h
Normal file
|
@ -0,0 +1,893 @@
|
|||
#ifndef _PYZMQ_CONSTANT_DEFS
|
||||
#define _PYZMQ_CONSTANT_DEFS
|
||||
|
||||
#ifdef ZMQ_BUILD_DRAFT_API
|
||||
#define PYZMQ_DRAFT_API 1
|
||||
#else
|
||||
#define PYZMQ_DRAFT_API 0
|
||||
#endif
|
||||
|
||||
#define _PYZMQ_UNDEFINED (-9999)
|
||||
#ifndef ZMQ_VERSION
|
||||
#define ZMQ_VERSION (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VERSION_MAJOR
|
||||
#define ZMQ_VERSION_MAJOR (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VERSION_MINOR
|
||||
#define ZMQ_VERSION_MINOR (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VERSION_PATCH
|
||||
#define ZMQ_VERSION_PATCH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_NOBLOCK
|
||||
#define ZMQ_NOBLOCK (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_DONTWAIT
|
||||
#define ZMQ_DONTWAIT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_POLLIN
|
||||
#define ZMQ_POLLIN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_POLLOUT
|
||||
#define ZMQ_POLLOUT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_POLLERR
|
||||
#define ZMQ_POLLERR (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_POLLPRI
|
||||
#define ZMQ_POLLPRI (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SNDMORE
|
||||
#define ZMQ_SNDMORE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_STREAMER
|
||||
#define ZMQ_STREAMER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_FORWARDER
|
||||
#define ZMQ_FORWARDER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_QUEUE
|
||||
#define ZMQ_QUEUE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IO_THREADS_DFLT
|
||||
#define ZMQ_IO_THREADS_DFLT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MAX_SOCKETS_DFLT
|
||||
#define ZMQ_MAX_SOCKETS_DFLT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_POLLITEMS_DFLT
|
||||
#define ZMQ_POLLITEMS_DFLT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_PRIORITY_DFLT
|
||||
#define ZMQ_THREAD_PRIORITY_DFLT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_SCHED_POLICY_DFLT
|
||||
#define ZMQ_THREAD_SCHED_POLICY_DFLT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PAIR
|
||||
#define ZMQ_PAIR (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PUB
|
||||
#define ZMQ_PUB (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SUB
|
||||
#define ZMQ_SUB (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_REQ
|
||||
#define ZMQ_REQ (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_REP
|
||||
#define ZMQ_REP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_DEALER
|
||||
#define ZMQ_DEALER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTER
|
||||
#define ZMQ_ROUTER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XREQ
|
||||
#define ZMQ_XREQ (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XREP
|
||||
#define ZMQ_XREP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PULL
|
||||
#define ZMQ_PULL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PUSH
|
||||
#define ZMQ_PUSH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XPUB
|
||||
#define ZMQ_XPUB (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XSUB
|
||||
#define ZMQ_XSUB (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_UPSTREAM
|
||||
#define ZMQ_UPSTREAM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_DOWNSTREAM
|
||||
#define ZMQ_DOWNSTREAM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_STREAM
|
||||
#define ZMQ_STREAM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SERVER
|
||||
#define ZMQ_SERVER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CLIENT
|
||||
#define ZMQ_CLIENT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RADIO
|
||||
#define ZMQ_RADIO (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_DISH
|
||||
#define ZMQ_DISH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GATHER
|
||||
#define ZMQ_GATHER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SCATTER
|
||||
#define ZMQ_SCATTER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_DGRAM
|
||||
#define ZMQ_DGRAM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_CONNECTED
|
||||
#define ZMQ_EVENT_CONNECTED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_CONNECT_DELAYED
|
||||
#define ZMQ_EVENT_CONNECT_DELAYED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_CONNECT_RETRIED
|
||||
#define ZMQ_EVENT_CONNECT_RETRIED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_LISTENING
|
||||
#define ZMQ_EVENT_LISTENING (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_BIND_FAILED
|
||||
#define ZMQ_EVENT_BIND_FAILED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_ACCEPTED
|
||||
#define ZMQ_EVENT_ACCEPTED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_ACCEPT_FAILED
|
||||
#define ZMQ_EVENT_ACCEPT_FAILED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_CLOSED
|
||||
#define ZMQ_EVENT_CLOSED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_CLOSE_FAILED
|
||||
#define ZMQ_EVENT_CLOSE_FAILED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_DISCONNECTED
|
||||
#define ZMQ_EVENT_DISCONNECTED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_ALL
|
||||
#define ZMQ_EVENT_ALL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_MONITOR_STOPPED
|
||||
#define ZMQ_EVENT_MONITOR_STOPPED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL
|
||||
#define ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_HANDSHAKE_SUCCEEDED
|
||||
#define ZMQ_EVENT_HANDSHAKE_SUCCEEDED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL
|
||||
#define ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENT_HANDSHAKE_FAILED_AUTH
|
||||
#define ZMQ_EVENT_HANDSHAKE_FAILED_AUTH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH
|
||||
#define ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED
|
||||
#define ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY
|
||||
#define ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID
|
||||
#define ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION
|
||||
#define ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE
|
||||
#define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA
|
||||
#define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_NOTIFY_CONNECT
|
||||
#define ZMQ_NOTIFY_CONNECT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_NOTIFY_DISCONNECT
|
||||
#define ZMQ_NOTIFY_DISCONNECT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_NULL
|
||||
#define ZMQ_NULL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PLAIN
|
||||
#define ZMQ_PLAIN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CURVE
|
||||
#define ZMQ_CURVE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI
|
||||
#define ZMQ_GSSAPI (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_NT_HOSTBASED
|
||||
#define ZMQ_GSSAPI_NT_HOSTBASED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_NT_USER_NAME
|
||||
#define ZMQ_GSSAPI_NT_USER_NAME (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_NT_KRB5_PRINCIPAL
|
||||
#define ZMQ_GSSAPI_NT_KRB5_PRINCIPAL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EAGAIN
|
||||
#define EAGAIN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EINVAL
|
||||
#define EINVAL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EFAULT
|
||||
#define EFAULT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENOMEM
|
||||
#define ENOMEM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENODEV
|
||||
#define ENODEV (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EMSGSIZE
|
||||
#define EMSGSIZE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENETUNREACH
|
||||
#define ENETUNREACH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ECONNABORTED
|
||||
#define ECONNABORTED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTCONN
|
||||
#define ENOTCONN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ETIMEDOUT
|
||||
#define ETIMEDOUT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EHOSTUNREACH
|
||||
#define EHOSTUNREACH (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENETRESET
|
||||
#define ENETRESET (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_HAUSNUMERO
|
||||
#define ZMQ_HAUSNUMERO (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSUP
|
||||
#define ENOTSUP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EPROTONOSUPPORT
|
||||
#define EPROTONOSUPPORT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENOBUFS
|
||||
#define ENOBUFS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENETDOWN
|
||||
#define ENETDOWN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EADDRINUSE
|
||||
#define EADDRINUSE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EADDRNOTAVAIL
|
||||
#define EADDRNOTAVAIL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ECONNREFUSED
|
||||
#define ECONNREFUSED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EINPROGRESS
|
||||
#define EINPROGRESS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSOCK
|
||||
#define ENOTSOCK (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EFSM
|
||||
#define EFSM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ENOCOMPATPROTO
|
||||
#define ENOCOMPATPROTO (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ETERM
|
||||
#define ETERM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef EMTHREAD
|
||||
#define EMTHREAD (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IO_THREADS
|
||||
#define ZMQ_IO_THREADS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MAX_SOCKETS
|
||||
#define ZMQ_MAX_SOCKETS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SOCKET_LIMIT
|
||||
#define ZMQ_SOCKET_LIMIT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_PRIORITY
|
||||
#define ZMQ_THREAD_PRIORITY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_SCHED_POLICY
|
||||
#define ZMQ_THREAD_SCHED_POLICY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_BLOCKY
|
||||
#define ZMQ_BLOCKY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MSG_T_SIZE
|
||||
#define ZMQ_MSG_T_SIZE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_AFFINITY_CPU_ADD
|
||||
#define ZMQ_THREAD_AFFINITY_CPU_ADD (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_AFFINITY_CPU_REMOVE
|
||||
#define ZMQ_THREAD_AFFINITY_CPU_REMOVE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_NAME_PREFIX
|
||||
#define ZMQ_THREAD_NAME_PREFIX (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IDENTITY
|
||||
#define ZMQ_IDENTITY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SUBSCRIBE
|
||||
#define ZMQ_SUBSCRIBE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_UNSUBSCRIBE
|
||||
#define ZMQ_UNSUBSCRIBE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_LAST_ENDPOINT
|
||||
#define ZMQ_LAST_ENDPOINT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TCP_ACCEPT_FILTER
|
||||
#define ZMQ_TCP_ACCEPT_FILTER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PLAIN_USERNAME
|
||||
#define ZMQ_PLAIN_USERNAME (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PLAIN_PASSWORD
|
||||
#define ZMQ_PLAIN_PASSWORD (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CURVE_PUBLICKEY
|
||||
#define ZMQ_CURVE_PUBLICKEY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CURVE_SECRETKEY
|
||||
#define ZMQ_CURVE_SECRETKEY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CURVE_SERVERKEY
|
||||
#define ZMQ_CURVE_SERVERKEY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ZAP_DOMAIN
|
||||
#define ZMQ_ZAP_DOMAIN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CONNECT_RID
|
||||
#define ZMQ_CONNECT_RID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_PRINCIPAL
|
||||
#define ZMQ_GSSAPI_PRINCIPAL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_SERVICE_PRINCIPAL
|
||||
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SOCKS_PROXY
|
||||
#define ZMQ_SOCKS_PROXY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XPUB_WELCOME_MSG
|
||||
#define ZMQ_XPUB_WELCOME_MSG (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTING_ID
|
||||
#define ZMQ_ROUTING_ID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CONNECT_ROUTING_ID
|
||||
#define ZMQ_CONNECT_ROUTING_ID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_BINDTODEVICE
|
||||
#define ZMQ_BINDTODEVICE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_FD
|
||||
#define ZMQ_FD (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RECONNECT_IVL_MAX
|
||||
#define ZMQ_RECONNECT_IVL_MAX (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SNDTIMEO
|
||||
#define ZMQ_SNDTIMEO (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RCVTIMEO
|
||||
#define ZMQ_RCVTIMEO (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SNDHWM
|
||||
#define ZMQ_SNDHWM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RCVHWM
|
||||
#define ZMQ_RCVHWM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MULTICAST_HOPS
|
||||
#define ZMQ_MULTICAST_HOPS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IPV4ONLY
|
||||
#define ZMQ_IPV4ONLY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTER_BEHAVIOR
|
||||
#define ZMQ_ROUTER_BEHAVIOR (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TCP_KEEPALIVE
|
||||
#define ZMQ_TCP_KEEPALIVE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TCP_KEEPALIVE_CNT
|
||||
#define ZMQ_TCP_KEEPALIVE_CNT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TCP_KEEPALIVE_IDLE
|
||||
#define ZMQ_TCP_KEEPALIVE_IDLE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TCP_KEEPALIVE_INTVL
|
||||
#define ZMQ_TCP_KEEPALIVE_INTVL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_DELAY_ATTACH_ON_CONNECT
|
||||
#define ZMQ_DELAY_ATTACH_ON_CONNECT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XPUB_VERBOSE
|
||||
#define ZMQ_XPUB_VERBOSE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_EVENTS
|
||||
#define ZMQ_EVENTS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TYPE
|
||||
#define ZMQ_TYPE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_LINGER
|
||||
#define ZMQ_LINGER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RECONNECT_IVL
|
||||
#define ZMQ_RECONNECT_IVL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_BACKLOG
|
||||
#define ZMQ_BACKLOG (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTER_MANDATORY
|
||||
#define ZMQ_ROUTER_MANDATORY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_FAIL_UNROUTABLE
|
||||
#define ZMQ_FAIL_UNROUTABLE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTER_RAW
|
||||
#define ZMQ_ROUTER_RAW (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IMMEDIATE
|
||||
#define ZMQ_IMMEDIATE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IPV6
|
||||
#define ZMQ_IPV6 (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MECHANISM
|
||||
#define ZMQ_MECHANISM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PLAIN_SERVER
|
||||
#define ZMQ_PLAIN_SERVER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CURVE_SERVER
|
||||
#define ZMQ_CURVE_SERVER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_PROBE_ROUTER
|
||||
#define ZMQ_PROBE_ROUTER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_REQ_RELAXED
|
||||
#define ZMQ_REQ_RELAXED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_REQ_CORRELATE
|
||||
#define ZMQ_REQ_CORRELATE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CONFLATE
|
||||
#define ZMQ_CONFLATE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTER_HANDOVER
|
||||
#define ZMQ_ROUTER_HANDOVER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TOS
|
||||
#define ZMQ_TOS (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IPC_FILTER_PID
|
||||
#define ZMQ_IPC_FILTER_PID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IPC_FILTER_UID
|
||||
#define ZMQ_IPC_FILTER_UID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_IPC_FILTER_GID
|
||||
#define ZMQ_IPC_FILTER_GID (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_SERVER
|
||||
#define ZMQ_GSSAPI_SERVER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_PLAINTEXT
|
||||
#define ZMQ_GSSAPI_PLAINTEXT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_HANDSHAKE_IVL
|
||||
#define ZMQ_HANDSHAKE_IVL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XPUB_NODROP
|
||||
#define ZMQ_XPUB_NODROP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XPUB_MANUAL
|
||||
#define ZMQ_XPUB_MANUAL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_STREAM_NOTIFY
|
||||
#define ZMQ_STREAM_NOTIFY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_INVERT_MATCHING
|
||||
#define ZMQ_INVERT_MATCHING (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_XPUB_VERBOSER
|
||||
#define ZMQ_XPUB_VERBOSER (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_HEARTBEAT_IVL
|
||||
#define ZMQ_HEARTBEAT_IVL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_HEARTBEAT_TTL
|
||||
#define ZMQ_HEARTBEAT_TTL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_HEARTBEAT_TIMEOUT
|
||||
#define ZMQ_HEARTBEAT_TIMEOUT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_CONNECT_TIMEOUT
|
||||
#define ZMQ_CONNECT_TIMEOUT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_TCP_MAXRT
|
||||
#define ZMQ_TCP_MAXRT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_THREAD_SAFE
|
||||
#define ZMQ_THREAD_SAFE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MULTICAST_MAXTPDU
|
||||
#define ZMQ_MULTICAST_MAXTPDU (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VMCI_CONNECT_TIMEOUT
|
||||
#define ZMQ_VMCI_CONNECT_TIMEOUT (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_USE_FD
|
||||
#define ZMQ_USE_FD (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_PRINCIPAL_NAMETYPE
|
||||
#define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE
|
||||
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MULTICAST_LOOP
|
||||
#define ZMQ_MULTICAST_LOOP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ROUTER_NOTIFY
|
||||
#define ZMQ_ROUTER_NOTIFY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_ZAP_ENFORCE_DOMAIN
|
||||
#define ZMQ_ZAP_ENFORCE_DOMAIN (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_AFFINITY
|
||||
#define ZMQ_AFFINITY (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MAXMSGSIZE
|
||||
#define ZMQ_MAXMSGSIZE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_HWM
|
||||
#define ZMQ_HWM (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SWAP
|
||||
#define ZMQ_SWAP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MCAST_LOOP
|
||||
#define ZMQ_MCAST_LOOP (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RECOVERY_IVL_MSEC
|
||||
#define ZMQ_RECOVERY_IVL_MSEC (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VMCI_BUFFER_SIZE
|
||||
#define ZMQ_VMCI_BUFFER_SIZE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VMCI_BUFFER_MIN_SIZE
|
||||
#define ZMQ_VMCI_BUFFER_MIN_SIZE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_VMCI_BUFFER_MAX_SIZE
|
||||
#define ZMQ_VMCI_BUFFER_MAX_SIZE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RATE
|
||||
#define ZMQ_RATE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RECOVERY_IVL
|
||||
#define ZMQ_RECOVERY_IVL (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SNDBUF
|
||||
#define ZMQ_SNDBUF (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RCVBUF
|
||||
#define ZMQ_RCVBUF (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_RCVMORE
|
||||
#define ZMQ_RCVMORE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_MORE
|
||||
#define ZMQ_MORE (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SRCFD
|
||||
#define ZMQ_SRCFD (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
#ifndef ZMQ_SHARED
|
||||
#define ZMQ_SHARED (_PYZMQ_UNDEFINED)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // ifndef _PYZMQ_CONSTANT_DEFS
|
Loading…
Add table
Add a link
Reference in a new issue