/zmq/core/socket.c
C | 11745 lines | 7798 code | 802 blank | 3145 comment | 1486 complexity | 9ae7b613a714132098158c41a6419f43 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0
Large files files are truncated, but you can click here to view the full file
- /* Generated by Cython 0.15.1 on Mon Dec 19 01:21:36 2011 */
- #define PY_SSIZE_T_CLEAN
- #include "Python.h"
- #ifndef Py_PYTHON_H
- #error Python headers needed to compile C extensions, please install development version of Python.
- #else
- #include <stddef.h> /* For offsetof */
- #ifndef offsetof
- #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
- #endif
- #if !defined(WIN32) && !defined(MS_WINDOWS)
- #ifndef __stdcall
- #define __stdcall
- #endif
- #ifndef __cdecl
- #define __cdecl
- #endif
- #ifndef __fastcall
- #define __fastcall
- #endif
- #endif
- #ifndef DL_IMPORT
- #define DL_IMPORT(t) t
- #endif
- #ifndef DL_EXPORT
- #define DL_EXPORT(t) t
- #endif
- #ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
- #endif
- #if PY_VERSION_HEX < 0x02040000
- #define METH_COEXIST 0
- #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
- #define PyDict_Contains(d,o) PySequence_Contains(d,o)
- #endif
- #if PY_VERSION_HEX < 0x02050000
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_SSIZE_T_MIN INT_MIN
- #define PY_FORMAT_SIZE_T ""
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
- #define PyNumber_Index(o) PyNumber_Int(o)
- #define PyIndex_Check(o) PyNumber_Check(o)
- #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
- #endif
- #if PY_VERSION_HEX < 0x02060000
- #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
- #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
- #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
- #define PyVarObject_HEAD_INIT(type, size) \
- PyObject_HEAD_INIT(type) size,
- #define PyType_Modified(t)
- typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
- } Py_buffer;
- #define PyBUF_SIMPLE 0
- #define PyBUF_WRITABLE 0x0001
- #define PyBUF_FORMAT 0x0004
- #define PyBUF_ND 0x0008
- #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
- #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
- #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
- #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
- #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
- #endif
- #if PY_MAJOR_VERSION < 3
- #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #else
- #define __Pyx_BUILTIN_MODULE_NAME "builtins"
- #endif
- #if PY_MAJOR_VERSION >= 3
- #define Py_TPFLAGS_CHECKTYPES 0
- #define Py_TPFLAGS_HAVE_INDEX 0
- #endif
- #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
- #define Py_TPFLAGS_HAVE_NEWBUFFER 0
- #endif
- #if PY_MAJOR_VERSION >= 3
- #define PyBaseString_Type PyUnicode_Type
- #define PyStringObject PyUnicodeObject
- #define PyString_Type PyUnicode_Type
- #define PyString_Check PyUnicode_Check
- #define PyString_CheckExact PyUnicode_CheckExact
- #endif
- #if PY_VERSION_HEX < 0x02060000
- #define PyBytesObject PyStringObject
- #define PyBytes_Type PyString_Type
- #define PyBytes_Check PyString_Check
- #define PyBytes_CheckExact PyString_CheckExact
- #define PyBytes_FromString PyString_FromString
- #define PyBytes_FromStringAndSize PyString_FromStringAndSize
- #define PyBytes_FromFormat PyString_FromFormat
- #define PyBytes_DecodeEscape PyString_DecodeEscape
- #define PyBytes_AsString PyString_AsString
- #define PyBytes_AsStringAndSize PyString_AsStringAndSize
- #define PyBytes_Size PyString_Size
- #define PyBytes_AS_STRING PyString_AS_STRING
- #define PyBytes_GET_SIZE PyString_GET_SIZE
- #define PyBytes_Repr PyString_Repr
- #define PyBytes_Concat PyString_Concat
- #define PyBytes_ConcatAndDel PyString_ConcatAndDel
- #endif
- #if PY_VERSION_HEX < 0x02060000
- #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
- #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
- #endif
- #ifndef PySet_CheckExact
- #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
- #endif
- #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
- #if PY_MAJOR_VERSION >= 3
- #define PyIntObject PyLongObject
- #define PyInt_Type PyLong_Type
- #define PyInt_Check(op) PyLong_Check(op)
- #define PyInt_CheckExact(op) PyLong_CheckExact(op)
- #define PyInt_FromString PyLong_FromString
- #define PyInt_FromUnicode PyLong_FromUnicode
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_FromSize_t PyLong_FromSize_t
- #define PyInt_FromSsize_t PyLong_FromSsize_t
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AS_LONG
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
- #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
- #endif
- #if PY_MAJOR_VERSION >= 3
- #define PyBoolObject PyLongObject
- #endif
- #if PY_VERSION_HEX < 0x03020000
- typedef long Py_hash_t;
- #define __Pyx_PyInt_FromHash_t PyInt_FromLong
- #define __Pyx_PyInt_AsHash_t PyInt_AsLong
- #else
- #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
- #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
- #endif
- #if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
- #else
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
- #endif
- #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
- #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
- #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
- #else
- #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
- #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
- #endif
- #if PY_MAJOR_VERSION >= 3
- #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
- #endif
- #if PY_VERSION_HEX < 0x02050000
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
- #else
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
- #endif
- #if PY_VERSION_HEX < 0x02050000
- #define __Pyx_NAMESTR(n) ((char *)(n))
- #define __Pyx_DOCSTR(n) ((char *)(n))
- #else
- #define __Pyx_NAMESTR(n) (n)
- #define __Pyx_DOCSTR(n) (n)
- #endif
- #ifndef __PYX_EXTERN_C
- #ifdef __cplusplus
- #define __PYX_EXTERN_C extern "C"
- #else
- #define __PYX_EXTERN_C extern
- #endif
- #endif
- #if defined(WIN32) || defined(MS_WINDOWS)
- #define _USE_MATH_DEFINES
- #endif
- #include <math.h>
- #define __PYX_HAVE__zmq__core__socket
- #define __PYX_HAVE_API__zmq__core__socket
- #include "allocate.h"
- #include "errno.h"
- #include "string.h"
- #include "zmq_compat.h"
- #include "zmq.h"
- #include "zmq_utils.h"
- #include "pyversion_compat.h"
- #include "stdio.h"
- #include "pythread.h"
- #ifdef _OPENMP
- #include <omp.h>
- #endif /* _OPENMP */
- #ifdef PYREX_WITHOUT_ASSERTIONS
- #define CYTHON_WITHOUT_ASSERTIONS
- #endif
- /* inline attribute */
- #ifndef CYTHON_INLINE
- #if defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_INLINE inline
- #else
- #define CYTHON_INLINE
- #endif
- #endif
- /* unused attribute */
- #ifndef CYTHON_UNUSED
- # if defined(__GNUC__)
- # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
- # define CYTHON_UNUSED __attribute__ ((__unused__))
- # else
- # define CYTHON_UNUSED
- # endif
- # elif defined(__ICC) || defined(__INTEL_COMPILER)
- # define CYTHON_UNUSED __attribute__ ((__unused__))
- # else
- # define CYTHON_UNUSED
- # endif
- #endif
- typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
- /* Type Conversion Predeclarations */
- #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
- #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
- #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
- #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
- static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
- static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
- static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
- static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
- static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
- #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
- #ifdef __GNUC__
- /* Test for GCC > 2.95 */
- #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- #else /* __GNUC__ > 2 ... */
- #define likely(x) (x)
- #define unlikely(x) (x)
- #endif /* __GNUC__ > 2 ... */
- #else /* __GNUC__ */
- #define likely(x) (x)
- #define unlikely(x) (x)
- #endif /* __GNUC__ */
-
- static PyObject *__pyx_m;
- static PyObject *__pyx_b;
- static PyObject *__pyx_empty_tuple;
- static PyObject *__pyx_empty_bytes;
- static int __pyx_lineno;
- static int __pyx_clineno = 0;
- static const char * __pyx_cfilenm= __FILE__;
- static const char *__pyx_filename;
- static const char *__pyx_f[] = {
- "socket.pyx",
- "socket.pxd",
- "buffers.pxd",
- "message.pxd",
- "context.pxd",
- "bool.pxd",
- "complex.pxd",
- };
- /*--- Type declarations ---*/
- struct __pyx_obj_3zmq_4core_6socket_Socket;
- struct __pyx_obj_3zmq_4core_7context_Context;
- struct __pyx_obj_3zmq_4core_7message_MessageTracker;
- struct __pyx_obj_3zmq_4core_7message_Message;
- struct __pyx_opt_args_3zmq_4core_6socket_6Socket_send;
- struct __pyx_opt_args_3zmq_4core_6socket_6Socket_recv;
- struct __pyx_opt_args_3zmq_4core_6socket__recv_message;
- struct __pyx_opt_args_3zmq_4core_6socket__recv_copy;
- struct __pyx_opt_args_3zmq_4core_6socket__send_message;
- struct __pyx_opt_args_3zmq_4core_6socket__send_copy;
- /* "zmq/core/socket.pxd":47
- *
- * # cpdef methods for direct-cython access:
- * cpdef object send(self, object data, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
- * cpdef object recv(self, int flags=*, copy=*, track=*)
- *
- */
- struct __pyx_opt_args_3zmq_4core_6socket_6Socket_send {
- int __pyx_n;
- int flags;
- PyObject *copy;
- PyObject *track;
- };
- /* "zmq/core/socket.pxd":48
- * # cpdef methods for direct-cython access:
- * cpdef object send(self, object data, int flags=*, copy=*, track=*)
- * cpdef object recv(self, int flags=*, copy=*, track=*) # <<<<<<<<<<<<<<
- *
- */
- struct __pyx_opt_args_3zmq_4core_6socket_6Socket_recv {
- int __pyx_n;
- int flags;
- PyObject *copy;
- PyObject *track;
- };
- /* "zmq/core/socket.pyx":99
- * return False
- *
- * cdef inline Message _recv_message(void *handle, int flags=0, track=False): # <<<<<<<<<<<<<<
- * """Receive a message in a non-copying manner and return a Message."""
- * cdef int rc
- */
- struct __pyx_opt_args_3zmq_4core_6socket__recv_message {
- int __pyx_n;
- int flags;
- PyObject *track;
- };
- /* "zmq/core/socket.pyx":112
- * return msg
- *
- * cdef inline object _recv_copy(void *handle, int flags=0): # <<<<<<<<<<<<<<
- * """Recieve a message and return a copy"""
- * cdef zmq_msg_t zmq_msg
- */
- struct __pyx_opt_args_3zmq_4core_6socket__recv_copy {
- int __pyx_n;
- int flags;
- };
- /* "zmq/core/socket.pyx":125
- * return msg_bytes
- *
- * cdef inline object _send_message(void *handle, Message msg, int flags=0): # <<<<<<<<<<<<<<
- * """Send a Message on this socket in a non-copy manner."""
- * cdef int rc
- */
- struct __pyx_opt_args_3zmq_4core_6socket__send_message {
- int __pyx_n;
- int flags;
- };
- /* "zmq/core/socket.pyx":144
- *
- *
- * cdef inline object _send_copy(void *handle, object msg, int flags=0): # <<<<<<<<<<<<<<
- * """Send a message on this socket by copying its content."""
- * cdef int rc, rc2
- */
- struct __pyx_opt_args_3zmq_4core_6socket__send_copy {
- int __pyx_n;
- int flags;
- };
- /* "zmq/core/socket.pxd":35
- *
- *
- * cdef class Socket: # <<<<<<<<<<<<<<
- * """A 0MQ socket."""
- *
- */
- struct __pyx_obj_3zmq_4core_6socket_Socket {
- PyObject_HEAD
- struct __pyx_vtabstruct_3zmq_4core_6socket_Socket *__pyx_vtab;
- void *handle;
- int socket_type;
- struct __pyx_obj_3zmq_4core_7context_Context *context;
- int _closed;
- PyObject *_attrs;
- };
- /* "context.pxd":26
- * #-----------------------------------------------------------------------------
- *
- * cdef class Context: # <<<<<<<<<<<<<<
- * """Manage the lifecycle of a 0MQ context."""
- *
- */
- struct __pyx_obj_3zmq_4core_7context_Context {
- PyObject_HEAD
- struct __pyx_vtabstruct_3zmq_4core_7context_Context *__pyx_vtab;
- void *handle;
- void **_sockets;
- size_t n_sockets;
- size_t max_sockets;
- PyObject *closed;
- };
- /* "message.pxd":32
- * #-----------------------------------------------------------------------------
- *
- * cdef class MessageTracker(object): # <<<<<<<<<<<<<<
- * """A class for tracking if 0MQ is done using one or more messages."""
- *
- */
- struct __pyx_obj_3zmq_4core_7message_MessageTracker {
- PyObject_HEAD
- PyObject *events;
- PyObject *peers;
- };
- /* "message.pxd":39
- *
- *
- * cdef class Message: # <<<<<<<<<<<<<<
- * """A Message class for non-copy send/recvs."""
- *
- */
- struct __pyx_obj_3zmq_4core_7message_Message {
- PyObject_HEAD
- struct __pyx_vtabstruct_3zmq_4core_7message_Message *__pyx_vtab;
- zmq_msg_t zmq_msg;
- PyObject *_data;
- PyObject *_buffer;
- PyObject *_bytes;
- int _failed_init;
- PyObject *tracker_event;
- PyObject *tracker;
- };
- /* "zmq/core/socket.pyx":171
- *
- *
- * cdef class Socket: # <<<<<<<<<<<<<<
- * """Socket(context, socket_type)
- *
- */
- struct __pyx_vtabstruct_3zmq_4core_6socket_Socket {
- PyObject *(*send)(struct __pyx_obj_3zmq_4core_6socket_Socket *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_4core_6socket_6Socket_send *__pyx_optional_args);
- PyObject *(*recv)(struct __pyx_obj_3zmq_4core_6socket_Socket *, int __pyx_skip_dispatch, struct __pyx_opt_args_3zmq_4core_6socket_6Socket_recv *__pyx_optional_args);
- };
- static struct __pyx_vtabstruct_3zmq_4core_6socket_Socket *__pyx_vtabptr_3zmq_4core_6socket_Socket;
- /* "message.pxd":39
- *
- *
- * cdef class Message: # <<<<<<<<<<<<<<
- * """A Message class for non-copy send/recvs."""
- *
- */
- struct __pyx_vtabstruct_3zmq_4core_7message_Message {
- struct __pyx_obj_3zmq_4core_7message_Message *(*fast_copy)(struct __pyx_obj_3zmq_4core_7message_Message *);
- PyObject *(*_getbuffer)(struct __pyx_obj_3zmq_4core_7message_Message *);
- };
- static struct __pyx_vtabstruct_3zmq_4core_7message_Message *__pyx_vtabptr_3zmq_4core_7message_Message;
- /* "context.pxd":26
- * #-----------------------------------------------------------------------------
- *
- * cdef class Context: # <<<<<<<<<<<<<<
- * """Manage the lifecycle of a 0MQ context."""
- *
- */
- struct __pyx_vtabstruct_3zmq_4core_7context_Context {
- void (*_add_socket)(struct __pyx_obj_3zmq_4core_7context_Context *, void *);
- void (*_remove_socket)(struct __pyx_obj_3zmq_4core_7context_Context *, void *);
- };
- static struct __pyx_vtabstruct_3zmq_4core_7context_Context *__pyx_vtabptr_3zmq_4core_7context_Context;
- #ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
- #endif
- #if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
- #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
- #define __Pyx_RefNannySetupContext(name) __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
- #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
- #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
- #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
- #else
- #define __Pyx_RefNannyDeclarations
- #define __Pyx_RefNannySetupContext(name)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XINCREF(r) Py_XINCREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
- #define __Pyx_XGOTREF(r)
- #define __Pyx_XGIVEREF(r)
- #endif /* CYTHON_REFNANNY */
- static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
- static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
- static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
- static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
- static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
- Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
- static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name, PyObject* kw_name); /*proto*/
- static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
- static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact); /*proto*/
- static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) {
- return unlikely(b < 0) ? b : !b;
- }
- static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
- return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
- }
- static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
- static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
- #if PY_MAJOR_VERSION >= 3
- static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
- PyObject *value;
- if (unlikely(d == Py_None)) {
- __Pyx_RaiseNoneIndexingError();
- return NULL;
- }
- value = PyDict_GetItemWithError(d, key);
- if (unlikely(!value)) {
- if (!PyErr_Occurred())
- PyErr_SetObject(PyExc_KeyError, key);
- return NULL;
- }
- Py_INCREF(value);
- return value;
- }
- #else
- #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
- #endif
- static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
- static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
- }
- #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_List_Fast(o, i) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
- static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
- if (likely(o != Py_None)) {
- if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
- PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
- Py_INCREF(r);
- return r;
- }
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
- }
- #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Tuple_Fast(o, i) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
- static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
- if (likely(o != Py_None)) {
- if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
- PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
- Py_INCREF(r);
- return r;
- }
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
- }
- #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Fast(o, i) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
- static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- }
- else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- }
- else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
- r = PySequence_GetItem(o, i);
- }
- else {
- r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
- }
- return r;
- }
- static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
- PyObject* value;
- #if PY_MAJOR_VERSION >= 3
- value = PyDict_GetItemWithError(d, key);
- if (unlikely(!value)) {
- if (unlikely(PyErr_Occurred()))
- return NULL;
- value = default_value;
- }
- Py_INCREF(value);
- #else
- if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
- /* these presumably have safe hash functions */
- value = PyDict_GetItem(d, key);
- if (unlikely(!value)) {
- value = default_value;
- }
- Py_INCREF(value);
- } else {
- PyObject *m;
- m = __Pyx_GetAttrString(d, "get");
- if (!m) return NULL;
- value = PyObject_CallFunctionObjArgs(m, key,
- (default_value == Py_None) ? NULL : default_value, NULL);
- Py_DECREF(m);
- }
- #endif
- return value;
- }
- static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
- static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
- static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
- #ifndef __PYX_FORCE_INIT_THREADS
- #if PY_VERSION_HEX < 0x02040200
- #define __PYX_FORCE_INIT_THREADS 1
- #else
- #define __PYX_FORCE_INIT_THREADS 0
- #endif
- #endif
- static CYTHON_INLINE pyzmq_int64_t __Pyx_PyInt_from_py_pyzmq_int64_t(PyObject *);
- static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_pyzmq_int64_t(pyzmq_int64_t);
- static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ZMQ_FD_T(ZMQ_FD_T);
- static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/
- #include <string.h>
- static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
- static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
- #if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
- #else
- #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
- #endif
- static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
- static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
- static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
- static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
- static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
- static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
- static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
- static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
- static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
- static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
- static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
- static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
- static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
- static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
- static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
- static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
- static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
- static int __Pyx_check_binary_version(void);
- static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
- static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
- static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
- static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
- static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/
- static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
- int __pyx_lineno, const char *__pyx_filename); /*proto*/
- static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
- /* Module declarations from 'zmq.core.libzmq' */
- /* Module declarations from 'zmq.core.message' */
- static PyTypeObject *__pyx_ptype_3zmq_4core_7message_MessageTracker = 0;
- static PyTypeObject *__pyx_ptype_3zmq_4core_7message_Message = 0;
- static PyObject *(*__pyx_f_3zmq_4core_7message_copy_zmq_msg_bytes)(zmq_msg_t *); /*proto*/
- /* Module declarations from 'zmq.core.context' */
- static PyTypeObject *__pyx_ptype_3zmq_4core_7context_Context = 0;
- /* Module declarations from 'cpython.version' */
- /* Module declarations from 'cpython.ref' */
- /* Module declarations from 'cpython.exc' */
- /* Module declarations from 'cpython.module' */
- /* Module declarations from 'cpython.mem' */
- /* Module declarations from 'cpython.tuple' */
- /* Module declarations from 'cpython.list' */
- /* Module declarations from 'libc.stdio' */
- /* Module declarations from 'cpython.object' */
- /* Module declarations from 'cpython.sequence' */
- /* Module declarations from 'cpython.mapping' */
- /* Module declarations from 'cpython.iterator' */
- /* Module declarations from 'cpython.type' */
- /* Module declarations from 'cpython.number' */
- /* Module declarations from 'cpython.int' */
- /* Module declarations from '__builtin__' */
- /* Module declarations from 'cpython.bool' */
- static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
- /* Module declarations from 'cpython.long' */
- /* Module declarations from 'cpython.float' */
- /* Module declarations from '__builtin__' */
- /* Module declarations from 'cpython.complex' */
- static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
- /* Module declarations from 'cpython.string' */
- /* Module declarations from 'cpython.unicode' */
- /* Module declarations from 'cpython.dict' */
- /* Module declarations from 'cpython.instance' */
- /* Module declarations from 'cpython.function' */
- /* Module declarations from 'cpython.method' */
- /* Module declarations from 'cpython.weakref' */
- /* Module declarations from 'cpython.getargs' */
- /* Module declarations from 'cpython.pythread' */
- /* Module declarations from 'cpython.pystate' */
- /* Module declarations from 'cpython.cobject' */
- /* Module declarations from 'cpython.oldbuffer' */
- /* Module declarations from 'cpython.set' */
- /* Module declarations from 'cpython.buffer' */
- /* Module declarations from 'cpython.bytes' */
- /* Module declarations from 'cpython.pycapsule' */
- /* Module declarations from 'cpython' */
- /* Module declarations from 'buffers' */
- static CYTHON_INLINE int __pyx_f_7buffers_newstyle_available(void); /*proto*/
- static CYTHON_INLINE int __pyx_f_7buffers_memoryview_available(void); /*proto*/
- static CYTHON_INLINE int __pyx_f_7buffers_oldstyle_available(void); /*proto*/
- static CYTHON_INLINE int __pyx_f_7buffers_check_buffer(PyObject *); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer(PyObject *, int, int, void **, Py_ssize_t *, Py_ssize_t *); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_r(PyObject *, void **, Py_ssize_t *); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_asbuffer_w(PyObject *, void **, Py_ssize_t *); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_3(void *, Py_ssize_t, int); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_2(void *, Py_ssize_t, int); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer(void *, Py_ssize_t, int); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_r(void *, Py_ssize_t); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_frombuffer_w(void *, Py_ssize_t); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject(PyObject *, int); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_r(PyObject *); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_7buffers_viewfromobject_w(PyObject *); /*proto*/
- /* Module declarations from 'zmq.core.socket' */
- static PyTypeObject *__pyx_ptype_3zmq_4core_6socket_Socket = 0;
- static CYTHON_INLINE PyObject *__pyx_f_3zmq_4core_6socket__check_closed(struct __pyx_obj_3zmq_4core_6socket_Socket *, int); /*proto*/
- static CYTHON_INLINE struct __pyx_obj_3zmq_4core_7message_Message *__pyx_f_3zmq_4core_6socket__recv_message(void *, struct __pyx_opt_args_3zmq_4core_6socket__recv_message *__pyx_optional_args); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_3zmq_4core_6socket__recv_copy(void *, struct __pyx_opt_args_3zmq_4core_6socket__recv_copy *__pyx_optional_args); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_3zmq_4core_6socket__send_message(void *, struct __pyx_obj_3zmq_4core_7message_Message *, struct __pyx_opt_args_3zmq_4core_6socket__send_message *__pyx_optional_args); /*proto*/
- static CYTHON_INLINE PyObject *__pyx_f_3zmq_4core_6socket__send_copy(void *, PyObject *, struct __pyx_opt_args_3zmq_4core_6socket__send_copy *__pyx_optional_args); /*proto*/
- #define __Pyx_MODULE_NAME "zmq.core.socket"
- int __pyx_module_is_main_zmq__core__socket = 0;
- /* Implementation of 'zmq.core.socket' */
- static PyObject *__pyx_builtin_property;
- static PyObject *__pyx_builtin_TypeError;
- static PyObject *__pyx_builtin_AttributeError;
- static PyObject *__pyx_builtin_xrange;
- static PyObject *__pyx_builtin_ValueError;
- static PyObject *__pyx_builtin_ImportError;
- static PyObject *__pyx_builtin_NotImplementedError;
- static char __pyx_k_2[] = "unicode not allowed, use setsockopt_unicode";
- static char __pyx_k_4[] = "expected bytes, got: %r";
- static char __pyx_k_5[] = "expected int, got: %r";
- static char __pyx_k_6[] = "utf-8";
- static char __pyx_k_7[] = "unicode strings only";
- static char __pyx_k_9[] = "option %i will not return a string to be decoded";
- static char __pyx_k_10[] = "zmq.core.socket";
- static char __pyx_k_11[] = "Socket has no such option: %s";
- static char __pyx_k_13[] = "expected str, got: %r";
- static char __pyx_k_14[] = "%s:%s";
- static char __pyx_k_15[] = "Could not bind socket to random port.";
- static char __pyx_k_20[] = "unicode not allowed, use send_unicode";
- static char __pyx_k_22[] = "Not a tracked message";
- static char __pyx_k_31[] = "unicode/str objects only";
- static char __pyx_k_33[] = "jsonlib{1,2}, json or simplejson library is required.";
- static char __pyx_k_36[] = "%r does not provide a buffer interface.";
- static char __pyx_k_37[] = "";
- static char __pyx_k_38[] = "New style buffers not available.";
- static char __pyx_k_40[] = "Old style buffers not available.";
- static char __pyx_k_42[] = "0MQ Socket class.";
- static char __pyx_k_43[] = "zmq.utils";
- static char __pyx_k_44[] = "zmq.core";
- static char __pyx_k_45[] = "zmq.core.constants";
- static char __pyx_k_46[] = "*";
- static char __pyx_k_47[] = "zmq.core.error";
- static char __pyx_k_48[] = "zmq.utils.strtypes";
- static char __pyx_k__B[] = "B";
- static char __pyx_k__u[] = "u";
- static char __pyx_k__obj[] = "obj";
- static char __pyx_k__sys[] = "sys";
- static char __pyx_k__zmq[] = "zmq";
- static char __pyx_k__addr[] = "addr";
- static char __pyx_k__bind[] = "bind";
- static char __pyx_k__char[] = "char";
- static char __pyx_k__copy[] = "copy";
- static char __pyx_k__data[] = "data";
- static char __pyx_k__poll[] = "poll";
- static char __pyx_k__recv[] = "recv";
- static char __pyx_k__send[] = "send";
- static char __pyx_k__time[] = "time";
- static char __pyx_k__bytes[] = "bytes";
- static char __pyx_k__close[] = "close";
- static char __pyx_k__dtype[] = "dtype";
- static char __pyx_k__dumps[] = "dumps";
- static char __pyx_k__flags[] = "flags";
- static char __pyx_k__loads[] = "loads";
- static char __pyx_k__range[] = "range";
- static char __pyx_k__track[] = "track";
- static char __pyx_k__upper[] = "upper";
- static char __pyx_k__POLLIN[] = "POLLIN";
- static char __pyx_k__Poller[] = "Poller";
- static char __pyx_k__Socket[] = "Socket";
- static char __pyx_k__buffer[] = "buffer";
- static char __pyx_k__closed[] = "closed";
- static char __pyx_k__codecs[] = "codecs";
- static char __pyx_k__decode[] = "decode";
- static char __pyx_k__encode[] = "encode";
- static char __pyx_k__linger[] = "linger";
- static char __pyx_k__option[] = "option";
- static char __pyx_k__optval[] = "optval";
- static char __pyx_k__pickle[] = "pickle";
- static char __pyx_k__prefix[] = "prefix";
- static char __pyx_k__random[] = "random";
- static char __pyx_k__struct[] = "struct";
- static char __pyx_k__xrange[] = "xrange";
- static char __pyx_k__ENOTSUP[] = "ENOTSUP";
- static char __pyx_k__POLLERR[] = "POLLERR";
- static char __pyx_k__SNDMORE[] = "SNDMORE";
- static char __pyx_k____all__[] = "__all__";
- static char __pyx_k___handle[] = "_handle";
- static char __pyx_k__cPickle[] = "cPickle";
- static char __pyx_k__context[] = "context";
- static char __pyx_k__jsonapi[] = "jsonapi";
- static char __pyx_k__jsonmod[] = "jsonmod";
- static char __pyx_k__timeout[] = "timeout";
- static char __pyx_k__tracker[] = "tracker";
- static char __pyx_k__unicode[] = "unicode";
- static char __pyx_k__ENOTSOCK[] = "ENOTSOCK";
- static char __pyx_k__ZMQError[] = "ZMQError";
- static char __pyx_k____main__[] = "__main__";
- static char __pyx_k____test__[] = "__test__";
- static char __pyx_k__copy_mod[] = "copy_mod";
- static char __pyx_k__encoding[] = "encoding";
- static char __pyx_k__itemsize[] = "itemsize";
- static char __pyx_k__max_port[] = "max_port";
- static char __pyx_k__min_port[] = "min_port";
- static char __pyx_k__property[] = "property";
- static char __pyx_k__protocol[] = "protocol";
- static char __pyx_k__register[] = "register";
- static char __pyx_k__typecode[] = "typecode";
- static char __pyx_k__TypeError[] = "TypeError";
- static char __pyx_k____class__[] = "__class__";
- static char __pyx_k__constants[] = "constants";
- static char __pyx_k__max_tries[] = "max_tries";
- static char __pyx_k__msg_parts[] = "msg_parts";
- static char __pyx_k__randrange[] = "randrange";
- static char __pyx_k__ValueError[] = "ValueError";
- static char __pyx_k____module__[] = "__module__";
- static char __pyx_k__basestring[] = "basestring";
- static char __pyx_k__getsockopt[] = "getsockopt";
- static char __pyx_k__setsockopt[] = "setsockopt";
- static char __pyx_k__ImportError[] = "ImportError";
- static char __pyx_k__socket_type[] = "socket_type";
- static char __pyx_k__ZMQBindError[] = "ZMQBindError";
- static char __pyx_k__AttributeError[] = "AttributeError";
- static char __pyx_k__bytes_sockopts[] = "bytes_sockopts";
- static char __pyx_k__int64_sockopts[] = "int64_sockopts";
- static char __pyx_k__NotImplementedError[] = "NotImplementedError";
- static PyObject *__pyx_kp_s_10;
- static PyObject *__pyx_kp_s_11;
- static PyObject *__pyx_kp_s_13;
- static PyObject *__pyx_kp_s_14;
- static PyObject *__pyx_kp_s_15;
- static PyObject *__pyx_kp_s_2;
- static PyObject *__pyx_kp_s_20;
- static PyObject *__pyx_kp_s_22;
- static PyObject *__pyx_kp_s_31;
- static PyObject *__pyx_kp_s_33;
- static PyObject *__pyx_kp_s_36;
- static PyObject *__pyx_kp_s_37;
- static PyObject *__pyx_kp_s_38;
- static PyObject *__pyx_kp_s_4;
- static PyObject *__pyx_kp_s_40;
- static PyObject *__pyx_n_s_43;
- static PyObject *__pyx_n_s_44;
- static PyObject *__pyx_n_s_45;
- static PyObject *__pyx_n_s_46;
- static PyObject *__pyx_n_s_47;
- static PyObject *__pyx_n_s_48;
- static PyObject *__pyx_kp_s_5;
- static PyObject *__pyx_kp_s_6;
- static PyObject *__pyx_kp_s_7;
- static PyObject *__pyx_kp_s_9;
- static PyObject *__pyx_n_s__AttributeError;
- static PyObject *__pyx_n_s__B;
- static PyObject *__pyx_n_s__ENOTSOCK;
- static PyObject *__pyx_n_s__ENOTSUP;
- static PyObject *__pyx_n_s__ImportError;
- static PyObject *__pyx_n_s__NotImplementedError;
- static PyObject *__pyx_n_s__POLLERR;
- static PyObject *__pyx_n_s__POLLIN;
- static PyObject *__pyx_n_s__Poller;
- static PyObject *__pyx_n_s__SNDMORE;
- static PyObject *__pyx_n_s__Socket;
- static PyObject *__pyx_n_s__TypeError;
- static PyObject *__pyx_n_s__ValueError;
- static PyObject *__pyx_n_s__ZMQBindError;
- static PyObject *__pyx_n_s__ZMQError;
- static PyObject *__pyx_n_s____all__;
- static PyObject *__pyx_n_s____class__;
- static PyObject *__pyx_n_s____main__;
- static PyObject *__pyx_n_s____module__;
- static PyObject *__pyx_n_s____test__;
- static PyObject *__pyx_n_s___handle;
- static PyObject *__pyx_n_s__addr;
- static PyObject *__pyx_n_s__basestring;
- static PyObject *__pyx_n_s__bind;
- static PyObject *__pyx_n_s__buffer;
- static PyObject *__pyx_n_s__bytes;
- static PyObject *__pyx_n_s__bytes_sockopts;
- static PyObject *__pyx_n_s__cPickle;
- static PyObject *__pyx_n_s__char;
- static PyObject *__pyx_n_s__close;
- static PyObject *__pyx_n_s__closed;
- static PyObject *__pyx_n_s__codecs;
- static PyObject *__pyx_n_s__constants;
- static PyObject *__pyx_n_s__context;
- static PyObject *__pyx_n_s__copy;
- static PyObject *__pyx_n_s__copy_mod;
- static PyObject *__pyx_n_s__data;
- static PyObject *__pyx_n_s__decode;
- static PyObject *__pyx_n_s__dtype;
- static PyObject *__pyx_n_s__dumps;
- static PyObject *__pyx_n_s__encode;
- static PyObject *__pyx_n_s__encoding;
- static PyObject *__pyx_n_s__flags;
- static PyObject *__pyx_n_s__getsockopt;
- static PyObject *__pyx_n_s__int64_sockopts;
- static PyObject *__pyx_n_s__itemsize;
- static PyObject *__pyx_n_s__jsonapi;
- static PyObject *__pyx_n_s__jsonmod;
- static PyObject *__pyx_n_s__linger;
- static PyObject *__pyx_n_s__loads;
- static PyObject *__pyx_n_s__max_port;
- static PyObject *__pyx_n_s__max_tries;
- static PyObject *__pyx_n_s__min_port;
- static PyObject *__pyx_n_s__msg_parts;
- static PyObject *__pyx_n_s__obj;
- static PyObject *__pyx_n_s__option;
- static PyObject *__pyx_n_s__optval;
- static PyObject *__pyx_n_s__pickle;
- static PyObject *__pyx_n_s__poll;
- static PyObject *__pyx_n_s__prefix;
- static PyObject *__pyx_n_s__property;
- static PyObject *__pyx_n_s__protocol;
- static PyObject *__pyx_n_s__random;
- static PyObject *__pyx_n_s__randrange;
- static PyObject *__pyx_n_s__range;
- static PyObject *__pyx_n_s__recv;
- static PyObject *__pyx_n_s__register;
- static PyObject *__pyx_n_s__send;
- static PyObject *__pyx_n_s__setsockopt;
- static PyObject *__pyx_n_s__socket_type;
- static PyObject *__pyx_n_s__struct;
- static PyObject *__pyx_n_s__sys;
- static PyObject *__pyx_n_s__time;
- static PyObject *__pyx_n_s__timeout;
- static PyObject *__pyx_n_s__track;
- static PyObject *__pyx_n_s__tracker;
- static PyObject *__pyx_n_s__typecode;
- static PyObject *__pyx_n_s__u;
- static PyObject *__pyx_n_s__unicode;
- static PyObject *__pyx_n_s__upper;
- static PyObject *__pyx_n_s__xrange;
- static PyObject *__pyx_n_s__zmq;
- static PyObject *__pyx_int_0;
- static PyObject *__pyx_int_neg_1;
- static PyObject *__pyx_int_100;
- static PyObject *__pyx_int_49152;
- static PyObject *__pyx_int_65536;
- static PyObject *__pyx_k_1;
- static PyObject *__pyx_k_18;
- static PyObject *__pyx_k_19;
- static PyObject *__pyx_k_24;
- static PyObject *__pyx_k_25;
- static PyObject *__pyx_k_26;
- static PyObject *__pyx_k_27;
- static PyObject *__pyx_k_28;
- static PyObject *__pyx_k_29;
- static PyObject *__pyx_k_30;
- static PyObject *__pyx_k_tuple_3;
- static PyObject *__pyx_k_tuple_8;
- static PyObject *__pyx_k_tuple_12;
- static PyObject *__pyx_k_tuple_16;
- static PyObject *__pyx_k_tuple_17;
- static PyObject *__pyx_k_tuple_21;
- static PyObject *__pyx_k_tuple_23;
- static PyObject *__pyx_k_tuple_32;
- static PyObject *__pyx_k_tuple_34;
- static PyObject *__pyx_k_tuple_35;
- static PyObject *__pyx_k_tuple_39;
- static PyObject *__pyx_k_tuple_41;
- /* "zmq/core/socket.pyx":77
- * # true methods frequently cannot be inlined, acc. Cython docs
- *
- * cdef inline _check_closed(Socket s, bint raise_notsup): # <<<<<<<<<<<<<<
- * cdef int rc
- * cdef int errno
- */
- static CYTHON_INLINE PyObject *__pyx_f_3zmq_4core_6socket__check_closed(struct __pyx_obj_3zmq_4core_6socket_Socket *__pyx_v_s, int __pyx_v_raise_notsup) {
- int __pyx_v_rc;
- int __pyx_v_stype;
- size_t __pyx_v_sz;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_check_closed");
- /* "zmq/core/socket.pyx":81
- * cdef int errno
- * cdef int stype
- * cdef size_t sz=sizeof(int) # <<<<<<<<<<<<<<
- * if s._closed:
- * if raise_notsup:
- */
- __pyx_v_sz = (sizeof(int));
- /* "zmq/core/socket.pyx":82
- * cdef int stype
- * cdef size_t sz=sizeof(int)
- * if s._closed: # <<<<<<<<<<<<<<
- * if raise_notsup:
- * raise ZMQError(ENOTSUP)
- */
- if (__pyx_v_s->_closed) {
- /* "zmq/core/socket.pyx":83
- * cdef size_t sz=sizeof(int)
- * if s._closed:
- * if raise_notsup: # <<<<<<<<<<<<<<
- * raise ZMQError(ENOTSUP)
- * else:
- */
- if (__pyx_v_raise_notsup) {
- /* "zmq/core/socket.pyx":84
- * if s._closed:
- * if raise_notsup:
- * raise ZMQError(ENOTSUP) # <<<<<<<<<<<<<<
- * else:
- * return True
- */
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ENOTSUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- /*else*/ {
- /* "zmq/core/socket.pyx":86
- * raise ZMQError(ENOTSUP)
- * else:
- * return True # <<<<<<<<<<<<<<
- * else:
- * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- /*else*/ {
- /* "zmq/core/socket.pyx":88
- * return True
- * else:
- * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz) # <<<<<<<<<<<<<<
- * if rc and zmq_errno() == ENOTSOCK:
- * s._closed = True
- */
- __pyx_v_rc = zmq_getsockopt(__pyx_v_s->handle, ZMQ_TYPE, ((void *)(&__pyx_v_stype)), (&__pyx_v_sz));
- /* "zmq/core/socket.pyx":89
- * else:
- * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
- * if rc and zmq_errno() == ENOTSOCK: # <<<<<<<<<<<<<<
- * s._closed = True
- * if raise_notsup:
- */
- if (__pyx_v_rc) {
- __pyx_t_2 = PyInt_FromLong(zmq_errno()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ENOTSOCK); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = __pyx_t_4;
- } else {
- __pyx_t_5 = __pyx_v_rc;
- }
- if (__pyx_t_5) {
- /* "zmq/core/socket.pyx":90
- * rc = zmq_getsockopt(s.handle, ZMQ_TYPE, <void *>&stype, &sz)
- * if rc and zmq_errno() == ENOTSOCK:
- * s._closed = True # <<<<<<<<<<<<<<
- * if raise_notsup:
- * raise ZMQError(ENOTSUP)
- */
- __pyx_v_s->_closed = 1;
- /* "zmq/core/socket.pyx":91
- * if rc and zmq_errno() == ENOTSOCK:
- * s._closed = True
- * if raise_notsup: # <<<<<<<<<<<<<<
- * raise ZMQError(ENOTSUP)
- * else:
- */
- if (__pyx_v_raise_notsup) {
- /* "zmq/core/socket.pyx":92
- * s._closed = True
- * if raise_notsup:
- * raise ZMQError(ENOTSUP) # <<<<<<<<<<<<<<
- * else:
- * return True
- */
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ENOTSUP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_…
Large files files are truncated, but you can click here to view the full file