~ubuntu-branches/ubuntu/precise/pyzmq/precise

« back to all changes in this revision

Viewing changes to zmq/_zmq.c

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-02-15 09:08:36 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110215090836-phh4slym1g6muucn
Tags: 2.0.10.1-2
* Team upload.
* Upload to unstable
* Add Breaks: ${python:Breaks}

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Generated by Cython 0.12.1 on Sat Jul  3 19:00:14 2010 */
2
 
 
3
 
#define PY_SSIZE_T_CLEAN
4
 
#include "Python.h"
5
 
#include "structmember.h"
6
 
#ifndef Py_PYTHON_H
7
 
    #error Python headers needed to compile C extensions, please install development version of Python.
8
 
#else
9
 
 
10
 
#ifndef PY_LONG_LONG
11
 
  #define PY_LONG_LONG LONG_LONG
12
 
#endif
13
 
#ifndef DL_EXPORT
14
 
  #define DL_EXPORT(t) t
15
 
#endif
16
 
#if PY_VERSION_HEX < 0x02040000
17
 
  #define METH_COEXIST 0
18
 
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
19
 
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
20
 
#endif
21
 
 
22
 
#if PY_VERSION_HEX < 0x02050000
23
 
  typedef int Py_ssize_t;
24
 
  #define PY_SSIZE_T_MAX INT_MAX
25
 
  #define PY_SSIZE_T_MIN INT_MIN
26
 
  #define PY_FORMAT_SIZE_T ""
27
 
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
28
 
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
29
 
  #define PyNumber_Index(o)    PyNumber_Int(o)
30
 
  #define PyIndex_Check(o)     PyNumber_Check(o)
31
 
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
32
 
#endif
33
 
 
34
 
#if PY_VERSION_HEX < 0x02060000
35
 
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
36
 
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
37
 
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
38
 
  #define PyVarObject_HEAD_INIT(type, size) \
39
 
          PyObject_HEAD_INIT(type) size,
40
 
  #define PyType_Modified(t)
41
 
 
42
 
  typedef struct {
43
 
     void *buf;
44
 
     PyObject *obj;
45
 
     Py_ssize_t len;
46
 
     Py_ssize_t itemsize;
47
 
     int readonly;
48
 
     int ndim;
49
 
     char *format;
50
 
     Py_ssize_t *shape;
51
 
     Py_ssize_t *strides;
52
 
     Py_ssize_t *suboffsets;
53
 
     void *internal;
54
 
  } Py_buffer;
55
 
 
56
 
  #define PyBUF_SIMPLE 0
57
 
  #define PyBUF_WRITABLE 0x0001
58
 
  #define PyBUF_FORMAT 0x0004
59
 
  #define PyBUF_ND 0x0008
60
 
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
61
 
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
62
 
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
63
 
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
64
 
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
65
 
 
66
 
#endif
67
 
 
68
 
#if PY_MAJOR_VERSION < 3
69
 
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
70
 
#else
71
 
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
72
 
#endif
73
 
 
74
 
#if PY_MAJOR_VERSION >= 3
75
 
  #define Py_TPFLAGS_CHECKTYPES 0
76
 
  #define Py_TPFLAGS_HAVE_INDEX 0
77
 
#endif
78
 
 
79
 
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
80
 
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
81
 
#endif
82
 
 
83
 
#if PY_MAJOR_VERSION >= 3
84
 
  #define PyBaseString_Type            PyUnicode_Type
85
 
  #define PyString_Type                PyUnicode_Type
86
 
  #define PyString_CheckExact          PyUnicode_CheckExact
87
 
#else
88
 
  #define PyBytes_Type                 PyString_Type
89
 
  #define PyBytes_CheckExact           PyString_CheckExact
90
 
#endif
91
 
 
92
 
#if PY_MAJOR_VERSION >= 3
93
 
  #define PyInt_Type                   PyLong_Type
94
 
  #define PyInt_Check(op)              PyLong_Check(op)
95
 
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
96
 
  #define PyInt_FromString             PyLong_FromString
97
 
  #define PyInt_FromUnicode            PyLong_FromUnicode
98
 
  #define PyInt_FromLong               PyLong_FromLong
99
 
  #define PyInt_FromSize_t             PyLong_FromSize_t
100
 
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
101
 
  #define PyInt_AsLong                 PyLong_AsLong
102
 
  #define PyInt_AS_LONG                PyLong_AS_LONG
103
 
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
104
 
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
105
 
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
106
 
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
107
 
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
108
 
#else
109
 
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
110
 
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
111
 
 
112
 
#endif
113
 
 
114
 
#if PY_MAJOR_VERSION >= 3
115
 
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
116
 
#endif
117
 
 
118
 
#if !defined(WIN32) && !defined(MS_WINDOWS)
119
 
  #ifndef __stdcall
120
 
    #define __stdcall
121
 
  #endif
122
 
  #ifndef __cdecl
123
 
    #define __cdecl
124
 
  #endif
125
 
  #ifndef __fastcall
126
 
    #define __fastcall
127
 
  #endif
128
 
#else
129
 
  #define _USE_MATH_DEFINES
130
 
#endif
131
 
 
132
 
#if PY_VERSION_HEX < 0x02050000
133
 
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
134
 
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
135
 
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
136
 
#else
137
 
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
138
 
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
139
 
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
140
 
#endif
141
 
 
142
 
#if PY_VERSION_HEX < 0x02050000
143
 
  #define __Pyx_NAMESTR(n) ((char *)(n))
144
 
  #define __Pyx_DOCSTR(n)  ((char *)(n))
145
 
#else
146
 
  #define __Pyx_NAMESTR(n) (n)
147
 
  #define __Pyx_DOCSTR(n)  (n)
148
 
#endif
149
 
#ifdef __cplusplus
150
 
#define __PYX_EXTERN_C extern "C"
151
 
#else
152
 
#define __PYX_EXTERN_C extern
153
 
#endif
154
 
#include <math.h>
155
 
#define __PYX_HAVE_API__zmq___zmq
156
 
#include "stdlib.h"
157
 
#include "errno.h"
158
 
#include "string.h"
159
 
#include "zmq_compat.h"
160
 
#include "zmq.h"
161
 
 
162
 
#ifndef CYTHON_INLINE
163
 
  #if defined(__GNUC__)
164
 
    #define CYTHON_INLINE __inline__
165
 
  #elif defined(_MSC_VER)
166
 
    #define CYTHON_INLINE __inline
167
 
  #else
168
 
    #define CYTHON_INLINE 
169
 
  #endif
170
 
#endif
171
 
 
172
 
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*/
173
 
 
174
 
 
175
 
/* Type Conversion Predeclarations */
176
 
 
177
 
#if PY_MAJOR_VERSION < 3
178
 
#define __Pyx_PyBytes_FromString          PyString_FromString
179
 
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
180
 
#define __Pyx_PyBytes_AsString            PyString_AsString
181
 
#else
182
 
#define __Pyx_PyBytes_FromString          PyBytes_FromString
183
 
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
184
 
#define __Pyx_PyBytes_AsString            PyBytes_AsString
185
 
#endif
186
 
 
187
 
#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
188
 
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
189
 
 
190
 
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
191
 
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
192
 
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
193
 
 
194
 
#if !defined(T_PYSSIZET)
195
 
#if PY_VERSION_HEX < 0x02050000
196
 
#define T_PYSSIZET T_INT
197
 
#elif !defined(T_LONGLONG)
198
 
#define T_PYSSIZET \
199
 
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
200
 
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
201
 
#else
202
 
#define T_PYSSIZET \
203
 
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
204
 
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
205
 
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
206
 
#endif
207
 
#endif
208
 
 
209
 
 
210
 
#if !defined(T_ULONGLONG)
211
 
#define __Pyx_T_UNSIGNED_INT(x) \
212
 
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
213
 
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
214
 
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
215
 
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
216
 
#else
217
 
#define __Pyx_T_UNSIGNED_INT(x) \
218
 
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
219
 
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
220
 
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
221
 
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
222
 
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
223
 
#endif
224
 
#if !defined(T_LONGLONG)
225
 
#define __Pyx_T_SIGNED_INT(x) \
226
 
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
227
 
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
228
 
        ((sizeof(x) == sizeof(int))   ? T_INT : \
229
 
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
230
 
#else
231
 
#define __Pyx_T_SIGNED_INT(x) \
232
 
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
233
 
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
234
 
        ((sizeof(x) == sizeof(int))   ? T_INT : \
235
 
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
236
 
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
237
 
#endif
238
 
 
239
 
#define __Pyx_T_FLOATING(x) \
240
 
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
241
 
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
242
 
 
243
 
#if !defined(T_SIZET)
244
 
#if !defined(T_ULONGLONG)
245
 
#define T_SIZET \
246
 
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
247
 
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
248
 
#else
249
 
#define T_SIZET \
250
 
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
251
 
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
252
 
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
253
 
#endif
254
 
#endif
255
 
 
256
 
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
257
 
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
258
 
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
259
 
 
260
 
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
261
 
 
262
 
 
263
 
#ifdef __GNUC__
264
 
/* Test for GCC > 2.95 */
265
 
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
266
 
#define likely(x)   __builtin_expect(!!(x), 1)
267
 
#define unlikely(x) __builtin_expect(!!(x), 0)
268
 
#else /* __GNUC__ > 2 ... */
269
 
#define likely(x)   (x)
270
 
#define unlikely(x) (x)
271
 
#endif /* __GNUC__ > 2 ... */
272
 
#else /* __GNUC__ */
273
 
#define likely(x)   (x)
274
 
#define unlikely(x) (x)
275
 
#endif /* __GNUC__ */
276
 
    
277
 
static PyObject *__pyx_m;
278
 
static PyObject *__pyx_b;
279
 
static PyObject *__pyx_empty_tuple;
280
 
static PyObject *__pyx_empty_bytes;
281
 
static int __pyx_lineno;
282
 
static int __pyx_clineno = 0;
283
 
static const char * __pyx_cfilenm= __FILE__;
284
 
static const char *__pyx_filename;
285
 
static const char **__pyx_f;
286
 
 
287
 
 
288
 
/* Type declarations */
289
 
 
290
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":270
291
 
 * 
292
 
 * 
293
 
 * cdef class Message:             # <<<<<<<<<<<<<<
294
 
 *     """A Message class for non-copy send/recvs.
295
 
 * 
296
 
 */
297
 
 
298
 
struct __pyx_obj_3zmq_4_zmq_Message {
299
 
  PyObject_HEAD
300
 
  struct __pyx_vtabstruct_3zmq_4_zmq_Message *__pyx_vtab;
301
 
  zmq_msg_t zmq_msg;
302
 
  PyObject *data;
303
 
};
304
 
 
305
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":400
306
 
 * 
307
 
 * 
308
 
 * cdef class Socket:             # <<<<<<<<<<<<<<
309
 
 *     """A 0MQ socket.
310
 
 * 
311
 
 */
312
 
 
313
 
struct __pyx_obj_3zmq_4_zmq_Socket {
314
 
  PyObject_HEAD
315
 
  void *handle;
316
 
  int socket_type;
317
 
  struct __pyx_obj_3zmq_4_zmq_Context *context;
318
 
  PyObject *closed;
319
 
};
320
 
 
321
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":359
322
 
 * 
323
 
 * 
324
 
 * cdef class Context:             # <<<<<<<<<<<<<<
325
 
 *     """Manage the lifecycle of a 0MQ context.
326
 
 * 
327
 
 */
328
 
 
329
 
struct __pyx_obj_3zmq_4_zmq_Context {
330
 
  PyObject_HEAD
331
 
  void *handle;
332
 
};
333
 
 
334
 
 
335
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":270
336
 
 * 
337
 
 * 
338
 
 * cdef class Message:             # <<<<<<<<<<<<<<
339
 
 *     """A Message class for non-copy send/recvs.
340
 
 * 
341
 
 */
342
 
 
343
 
struct __pyx_vtabstruct_3zmq_4_zmq_Message {
344
 
  struct __pyx_obj_3zmq_4_zmq_Message *(*fast_copy)(struct __pyx_obj_3zmq_4_zmq_Message *);
345
 
};
346
 
static struct __pyx_vtabstruct_3zmq_4_zmq_Message *__pyx_vtabptr_3zmq_4_zmq_Message;
347
 
 
348
 
#ifndef CYTHON_REFNANNY
349
 
  #define CYTHON_REFNANNY 0
350
 
#endif
351
 
 
352
 
#if CYTHON_REFNANNY
353
 
  typedef struct {
354
 
    void (*INCREF)(void*, PyObject*, int);
355
 
    void (*DECREF)(void*, PyObject*, int);
356
 
    void (*GOTREF)(void*, PyObject*, int);
357
 
    void (*GIVEREF)(void*, PyObject*, int);
358
 
    void* (*SetupContext)(const char*, int, const char*);
359
 
    void (*FinishContext)(void**);
360
 
  } __Pyx_RefNannyAPIStruct;
361
 
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
362
 
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
363
 
    PyObject *m = NULL, *p = NULL;
364
 
    void *r = NULL;
365
 
    m = PyImport_ImportModule((char *)modname);
366
 
    if (!m) goto end;
367
 
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
368
 
    if (!p) goto end;
369
 
    r = PyLong_AsVoidPtr(p);
370
 
  end:
371
 
    Py_XDECREF(p);
372
 
    Py_XDECREF(m);
373
 
    return (__Pyx_RefNannyAPIStruct *)r;
374
 
  }
375
 
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
376
 
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
377
 
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
378
 
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
379
 
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
380
 
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
381
 
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
382
 
#else
383
 
  #define __Pyx_RefNannySetupContext(name)
384
 
  #define __Pyx_RefNannyFinishContext()
385
 
  #define __Pyx_INCREF(r) Py_INCREF(r)
386
 
  #define __Pyx_DECREF(r) Py_DECREF(r)
387
 
  #define __Pyx_GOTREF(r)
388
 
  #define __Pyx_GIVEREF(r)
389
 
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
390
 
#endif /* CYTHON_REFNANNY */
391
 
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
392
 
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
393
 
 
394
 
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
395
 
 
396
 
static void __Pyx_RaiseDoubleKeywordsError(
397
 
    const char* func_name, PyObject* kw_name); /*proto*/
398
 
 
399
 
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
400
 
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
401
 
 
402
 
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
403
 
 
404
 
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
405
 
 
406
 
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
407
 
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
408
 
 
409
 
 
410
 
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
411
 
    PyObject *r;
412
 
    if (!j) return NULL;
413
 
    r = PyObject_GetItem(o, j);
414
 
    Py_DECREF(j);
415
 
    return r;
416
 
}
417
 
 
418
 
 
419
 
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
420
 
                                                    __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
421
 
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
422
 
 
423
 
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
424
 
    if (likely(o != Py_None)) {
425
 
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
426
 
            PyObject *r = PyList_GET_ITEM(o, i);
427
 
            Py_INCREF(r);
428
 
            return r;
429
 
        }
430
 
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
431
 
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
432
 
            Py_INCREF(r);
433
 
            return r;
434
 
        }
435
 
    }
436
 
    return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
437
 
}
438
 
 
439
 
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
440
 
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
441
 
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
442
 
 
443
 
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
444
 
    if (likely(o != Py_None)) {
445
 
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
446
 
            PyObject *r = PyTuple_GET_ITEM(o, i);
447
 
            Py_INCREF(r);
448
 
            return r;
449
 
        }
450
 
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
451
 
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
452
 
            Py_INCREF(r);
453
 
            return r;
454
 
        }
455
 
    }
456
 
    return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
457
 
}
458
 
 
459
 
 
460
 
#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
461
 
                                                    __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
462
 
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
463
 
 
464
 
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
465
 
    PyObject *r;
466
 
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
467
 
        r = PyList_GET_ITEM(o, i);
468
 
        Py_INCREF(r);
469
 
    }
470
 
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
471
 
        r = PyTuple_GET_ITEM(o, i);
472
 
        Py_INCREF(r);
473
 
    }
474
 
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
475
 
        r = PySequence_GetItem(o, i);
476
 
    }
477
 
    else {
478
 
        r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
479
 
    }
480
 
    return r;
481
 
}
482
 
 
483
 
static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
484
 
    if (likely(PyList_CheckExact(L))) {
485
 
        if (PyList_Append(L, x) < 0) return NULL;
486
 
        Py_INCREF(Py_None);
487
 
        return Py_None; /* this is just to have an accurate signature */
488
 
    }
489
 
    else {
490
 
        PyObject *r, *m;
491
 
        m = __Pyx_GetAttrString(L, "append");
492
 
        if (!m) return NULL;
493
 
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
494
 
        Py_DECREF(m);
495
 
        return r;
496
 
    }
497
 
}
498
 
 
499
 
static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; }
500
 
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
501
 
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
502
 
}
503
 
 
504
 
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
505
 
 
506
 
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);
507
 
 
508
 
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
509
 
static int __Pyx_EndUnpack(PyObject *); /*proto*/
510
 
 
511
 
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
512
 
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
513
 
 
514
 
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
515
 
    const char *name, int exact); /*proto*/
516
 
 
517
 
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
518
 
 
519
 
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
520
 
 
521
 
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
522
 
 
523
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
524
 
 
525
 
#ifndef __PYX_FORCE_INIT_THREADS
526
 
  #if PY_VERSION_HEX < 0x02040200
527
 
    #define __PYX_FORCE_INIT_THREADS 1
528
 
  #else
529
 
    #define __PYX_FORCE_INIT_THREADS 0
530
 
  #endif
531
 
#endif
532
 
 
533
 
static CYTHON_INLINE pyzmq_int64_t __Pyx_PyInt_from_py_pyzmq_int64_t(PyObject *);
534
 
 
535
 
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_pyzmq_int64_t(pyzmq_int64_t);
536
 
 
537
 
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
538
 
 
539
 
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
540
 
 
541
 
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
542
 
 
543
 
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
544
 
 
545
 
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
546
 
 
547
 
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
548
 
 
549
 
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
550
 
 
551
 
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
552
 
 
553
 
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
554
 
 
555
 
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
556
 
 
557
 
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
558
 
 
559
 
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
560
 
 
561
 
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
562
 
 
563
 
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
564
 
 
565
 
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
566
 
 
567
 
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
568
 
 
569
 
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
570
 
 
571
 
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
572
 
/* Module declarations from stdlib */
573
 
 
574
 
/* Module declarations from python_ref */
575
 
 
576
 
/* Module declarations from python_string */
577
 
 
578
 
/* Module declarations from zmq._zmq */
579
 
 
580
 
static PyTypeObject *__pyx_ptype_3zmq_4_zmq_Message = 0;
581
 
static PyTypeObject *__pyx_ptype_3zmq_4_zmq_Context = 0;
582
 
static PyTypeObject *__pyx_ptype_3zmq_4_zmq_Socket = 0;
583
 
static CYTHON_INLINE void *__pyx_f_3zmq_4_zmq_memnew(size_t); /*proto*/
584
 
static CYTHON_INLINE void __pyx_f_3zmq_4_zmq_memdel(void *); /*proto*/
585
 
static CYTHON_INLINE PyObject *__pyx_f_3zmq_4_zmq_allocate(size_t, void **); /*proto*/
586
 
static void __pyx_f_3zmq_4_zmq_free_python_msg(void *, void *); /*proto*/
587
 
#define __Pyx_MODULE_NAME "zmq._zmq"
588
 
int __pyx_module_is_main_zmq___zmq = 0;
589
 
 
590
 
/* Implementation of zmq._zmq */
591
 
static PyObject *__pyx_builtin_ImportError;
592
 
static PyObject *__pyx_builtin_Exception;
593
 
static PyObject *__pyx_builtin_object;
594
 
static PyObject *__pyx_builtin_MemoryError;
595
 
static PyObject *__pyx_builtin_TypeError;
596
 
static PyObject *__pyx_builtin_range;
597
 
static PyObject *__pyx_builtin_ValueError;
598
 
static char __pyx_k_1[] = "expected str, got: %r";
599
 
static char __pyx_k_2[] = "expected int, got: %r";
600
 
static char __pyx_k_3[] = "%s:%s";
601
 
static char __pyx_k_4[] = "Could not bind socket to random port.";
602
 
static char __pyx_k_9[] = "json or simplejson library is required.";
603
 
static char __pyx_k_10[] = ",";
604
 
static char __pyx_k_11[] = ":";
605
 
static char __pyx_k_12[] = "fileno() must return an valid integer fd";
606
 
static char __pyx_k_13[] = "Socket must be a 0MQ socket, an integer fd or have a fileno() method: %r";
607
 
static char __pyx_k_16[] = "Python bindings for 0MQ.";
608
 
static char __pyx_k_17[] = "Base exception class for 0MQ errors in Python.";
609
 
static char __pyx_k_18[] = "An error for bind_to_random_port.";
610
 
static char __pyx_k_19[] = "An stateful poll interface that mirrors Python's built-in poll.";
611
 
static char __pyx_k__fd[] = "fd";
612
 
static char __pyx_k__HWM[] = "HWM";
613
 
static char __pyx_k__PUB[] = "PUB";
614
 
static char __pyx_k__REP[] = "REP";
615
 
static char __pyx_k__REQ[] = "REQ";
616
 
static char __pyx_k__SUB[] = "SUB";
617
 
static char __pyx_k__msg[] = "msg";
618
 
static char __pyx_k__obj[] = "obj";
619
 
static char __pyx_k__EFSM[] = "EFSM";
620
 
static char __pyx_k__PAIR[] = "PAIR";
621
 
static char __pyx_k__RATE[] = "RATE";
622
 
static char __pyx_k__SWAP[] = "SWAP";
623
 
static char __pyx_k__XREP[] = "XREP";
624
 
static char __pyx_k__XREQ[] = "XREQ";
625
 
static char __pyx_k__addr[] = "addr";
626
 
static char __pyx_k__bind[] = "bind";
627
 
static char __pyx_k__copy[] = "copy";
628
 
static char __pyx_k__data[] = "data";
629
 
static char __pyx_k__json[] = "json";
630
 
static char __pyx_k__poll[] = "poll";
631
 
static char __pyx_k__recv[] = "recv";
632
 
static char __pyx_k__self[] = "self";
633
 
static char __pyx_k__send[] = "send";
634
 
static char __pyx_k__ETERM[] = "ETERM";
635
 
static char __pyx_k___poll[] = "_poll";
636
 
static char __pyx_k__close[] = "close";
637
 
static char __pyx_k__dumps[] = "dumps";
638
 
static char __pyx_k__errno[] = "errno";
639
 
static char __pyx_k__error[] = "error";
640
 
static char __pyx_k__flags[] = "flags";
641
 
static char __pyx_k__items[] = "items";
642
 
static char __pyx_k__loads[] = "loads";
643
 
static char __pyx_k__range[] = "range";
644
 
static char __pyx_k__rlist[] = "rlist";
645
 
static char __pyx_k__wlist[] = "wlist";
646
 
static char __pyx_k__xlist[] = "xlist";
647
 
static char __pyx_k__EAGAIN[] = "EAGAIN";
648
 
static char __pyx_k__EINVAL[] = "EINVAL";
649
 
static char __pyx_k__POLLIN[] = "POLLIN";
650
 
static char __pyx_k__Poller[] = "Poller";
651
 
static char __pyx_k__RCVBUF[] = "RCVBUF";
652
 
static char __pyx_k__SNDBUF[] = "SNDBUF";
653
 
static char __pyx_k__Socket[] = "Socket";
654
 
static char __pyx_k__closed[] = "closed";
655
 
static char __pyx_k__errstr[] = "errstr";
656
 
static char __pyx_k__events[] = "events";
657
 
static char __pyx_k__fileno[] = "fileno";
658
 
static char __pyx_k__handle[] = "handle";
659
 
static char __pyx_k__modify[] = "modify";
660
 
static char __pyx_k__object[] = "object";
661
 
static char __pyx_k__option[] = "option";
662
 
static char __pyx_k__optval[] = "optval";
663
 
static char __pyx_k__pickle[] = "pickle";
664
 
static char __pyx_k__random[] = "random";
665
 
static char __pyx_k__select[] = "select";
666
 
static char __pyx_k__socket[] = "socket";
667
 
static char __pyx_k__struct[] = "struct";
668
 
static char __pyx_k__Context[] = "Context";
669
 
static char __pyx_k__ENOBUFS[] = "ENOBUFS";
670
 
static char __pyx_k__ENOTSUP[] = "ENOTSUP";
671
 
static char __pyx_k__Message[] = "Message";
672
 
static char __pyx_k__NOBLOCK[] = "NOBLOCK";
673
 
static char __pyx_k__POLLERR[] = "POLLERR";
674
 
static char __pyx_k__POLLOUT[] = "POLLOUT";
675
 
static char __pyx_k__RCVMORE[] = "RCVMORE";
676
 
static char __pyx_k__SNDMORE[] = "SNDMORE";
677
 
static char __pyx_k____all__[] = "__all__";
678
 
static char __pyx_k____str__[] = "__str__";
679
 
static char __pyx_k__cPickle[] = "cPickle";
680
 
static char __pyx_k__context[] = "context";
681
 
static char __pyx_k__rcvmore[] = "rcvmore";
682
 
static char __pyx_k__revents[] = "revents";
683
 
static char __pyx_k__sockets[] = "sockets";
684
 
static char __pyx_k__timeout[] = "timeout";
685
 
static char __pyx_k__zmq_msg[] = "zmq_msg";
686
 
static char __pyx_k__AFFINITY[] = "AFFINITY";
687
 
static char __pyx_k__EMTHREAD[] = "EMTHREAD";
688
 
static char __pyx_k__ENETDOWN[] = "ENETDOWN";
689
 
static char __pyx_k__IDENTITY[] = "IDENTITY";
690
 
static char __pyx_k__UPSTREAM[] = "UPSTREAM";
691
 
static char __pyx_k__ZMQError[] = "ZMQError";
692
 
static char __pyx_k____init__[] = "__init__";
693
 
static char __pyx_k____main__[] = "__main__";
694
 
static char __pyx_k__copy_mod[] = "copy_mod";
695
 
static char __pyx_k__max_port[] = "max_port";
696
 
static char __pyx_k__min_port[] = "min_port";
697
 
static char __pyx_k__protocol[] = "protocol";
698
 
static char __pyx_k__register[] = "register";
699
 
static char __pyx_k__strerror[] = "strerror";
700
 
static char __pyx_k__Exception[] = "Exception";
701
 
static char __pyx_k__SUBSCRIBE[] = "SUBSCRIBE";
702
 
static char __pyx_k__TypeError[] = "TypeError";
703
 
static char __pyx_k__fast_copy[] = "fast_copy";
704
 
static char __pyx_k__max_tries[] = "max_tries";
705
 
static char __pyx_k__msg_parts[] = "msg_parts";
706
 
static char __pyx_k__randrange[] = "randrange";
707
 
static char __pyx_k__DOWNSTREAM[] = "DOWNSTREAM";
708
 
static char __pyx_k__EADDRINUSE[] = "EADDRINUSE";
709
 
static char __pyx_k__MCAST_LOOP[] = "MCAST_LOOP";
710
 
static char __pyx_k__ValueError[] = "ValueError";
711
 
static char __pyx_k___recv_copy[] = "_recv_copy";
712
 
static char __pyx_k___send_copy[] = "_send_copy";
713
 
static char __pyx_k__getsockopt[] = "getsockopt";
714
 
static char __pyx_k__io_threads[] = "io_threads";
715
 
static char __pyx_k__separators[] = "separators";
716
 
static char __pyx_k__simplejson[] = "simplejson";
717
 
static char __pyx_k__unregister[] = "unregister";
718
 
static char __pyx_k__EINPROGRESS[] = "EINPROGRESS";
719
 
static char __pyx_k__ImportError[] = "ImportError";
720
 
static char __pyx_k__MemoryError[] = "MemoryError";
721
 
static char __pyx_k__UNSUBSCRIBE[] = "UNSUBSCRIBE";
722
 
static char __pyx_k__socket_type[] = "socket_type";
723
 
static char __pyx_k__ECONNREFUSED[] = "ECONNREFUSED";
724
 
static char __pyx_k__RECOVERY_IVL[] = "RECOVERY_IVL";
725
 
static char __pyx_k__ZMQBaseError[] = "ZMQBaseError";
726
 
static char __pyx_k__ZMQBindError[] = "ZMQBindError";
727
 
static char __pyx_k__EADDRNOTAVAIL[] = "EADDRNOTAVAIL";
728
 
static char __pyx_k___check_closed[] = "_check_closed";
729
 
static char __pyx_k___recv_message[] = "_recv_message";
730
 
static char __pyx_k___send_message[] = "_send_message";
731
 
static char __pyx_k__ENOCOMPATPROTO[] = "ENOCOMPATPROTO";
732
 
static char __pyx_k__EPROTONOSUPPORT[] = "EPROTONOSUPPORT";
733
 
static PyObject *__pyx_kp_s_1;
734
 
static PyObject *__pyx_kp_s_10;
735
 
static PyObject *__pyx_kp_s_11;
736
 
static PyObject *__pyx_kp_s_12;
737
 
static PyObject *__pyx_kp_s_13;
738
 
static PyObject *__pyx_kp_s_17;
739
 
static PyObject *__pyx_kp_s_18;
740
 
static PyObject *__pyx_kp_s_19;
741
 
static PyObject *__pyx_kp_s_2;
742
 
static PyObject *__pyx_kp_s_3;
743
 
static PyObject *__pyx_kp_s_4;
744
 
static PyObject *__pyx_kp_s_9;
745
 
static PyObject *__pyx_n_s__AFFINITY;
746
 
static PyObject *__pyx_n_s__Context;
747
 
static PyObject *__pyx_n_s__DOWNSTREAM;
748
 
static PyObject *__pyx_n_s__EADDRINUSE;
749
 
static PyObject *__pyx_n_s__EADDRNOTAVAIL;
750
 
static PyObject *__pyx_n_s__EAGAIN;
751
 
static PyObject *__pyx_n_s__ECONNREFUSED;
752
 
static PyObject *__pyx_n_s__EFSM;
753
 
static PyObject *__pyx_n_s__EINPROGRESS;
754
 
static PyObject *__pyx_n_s__EINVAL;
755
 
static PyObject *__pyx_n_s__EMTHREAD;
756
 
static PyObject *__pyx_n_s__ENETDOWN;
757
 
static PyObject *__pyx_n_s__ENOBUFS;
758
 
static PyObject *__pyx_n_s__ENOCOMPATPROTO;
759
 
static PyObject *__pyx_n_s__ENOTSUP;
760
 
static PyObject *__pyx_n_s__EPROTONOSUPPORT;
761
 
static PyObject *__pyx_n_s__ETERM;
762
 
static PyObject *__pyx_n_s__Exception;
763
 
static PyObject *__pyx_n_s__HWM;
764
 
static PyObject *__pyx_n_s__IDENTITY;
765
 
static PyObject *__pyx_n_s__ImportError;
766
 
static PyObject *__pyx_n_s__MCAST_LOOP;
767
 
static PyObject *__pyx_n_s__MemoryError;
768
 
static PyObject *__pyx_n_s__Message;
769
 
static PyObject *__pyx_n_s__NOBLOCK;
770
 
static PyObject *__pyx_n_s__PAIR;
771
 
static PyObject *__pyx_n_s__POLLERR;
772
 
static PyObject *__pyx_n_s__POLLIN;
773
 
static PyObject *__pyx_n_s__POLLOUT;
774
 
static PyObject *__pyx_n_s__PUB;
775
 
static PyObject *__pyx_n_s__Poller;
776
 
static PyObject *__pyx_n_s__RATE;
777
 
static PyObject *__pyx_n_s__RCVBUF;
778
 
static PyObject *__pyx_n_s__RCVMORE;
779
 
static PyObject *__pyx_n_s__RECOVERY_IVL;
780
 
static PyObject *__pyx_n_s__REP;
781
 
static PyObject *__pyx_n_s__REQ;
782
 
static PyObject *__pyx_n_s__SNDBUF;
783
 
static PyObject *__pyx_n_s__SNDMORE;
784
 
static PyObject *__pyx_n_s__SUB;
785
 
static PyObject *__pyx_n_s__SUBSCRIBE;
786
 
static PyObject *__pyx_n_s__SWAP;
787
 
static PyObject *__pyx_n_s__Socket;
788
 
static PyObject *__pyx_n_s__TypeError;
789
 
static PyObject *__pyx_n_s__UNSUBSCRIBE;
790
 
static PyObject *__pyx_n_s__UPSTREAM;
791
 
static PyObject *__pyx_n_s__ValueError;
792
 
static PyObject *__pyx_n_s__XREP;
793
 
static PyObject *__pyx_n_s__XREQ;
794
 
static PyObject *__pyx_n_s__ZMQBaseError;
795
 
static PyObject *__pyx_n_s__ZMQBindError;
796
 
static PyObject *__pyx_n_s__ZMQError;
797
 
static PyObject *__pyx_n_s____all__;
798
 
static PyObject *__pyx_n_s____init__;
799
 
static PyObject *__pyx_n_s____main__;
800
 
static PyObject *__pyx_n_s____str__;
801
 
static PyObject *__pyx_n_s___check_closed;
802
 
static PyObject *__pyx_n_s___poll;
803
 
static PyObject *__pyx_n_s___recv_copy;
804
 
static PyObject *__pyx_n_s___recv_message;
805
 
static PyObject *__pyx_n_s___send_copy;
806
 
static PyObject *__pyx_n_s___send_message;
807
 
static PyObject *__pyx_n_s__addr;
808
 
static PyObject *__pyx_n_s__bind;
809
 
static PyObject *__pyx_n_s__cPickle;
810
 
static PyObject *__pyx_n_s__close;
811
 
static PyObject *__pyx_n_s__closed;
812
 
static PyObject *__pyx_n_s__context;
813
 
static PyObject *__pyx_n_s__copy;
814
 
static PyObject *__pyx_n_s__copy_mod;
815
 
static PyObject *__pyx_n_s__data;
816
 
static PyObject *__pyx_n_s__dumps;
817
 
static PyObject *__pyx_n_s__errno;
818
 
static PyObject *__pyx_n_s__error;
819
 
static PyObject *__pyx_n_s__errstr;
820
 
static PyObject *__pyx_n_s__events;
821
 
static PyObject *__pyx_n_s__fast_copy;
822
 
static PyObject *__pyx_n_s__fd;
823
 
static PyObject *__pyx_n_s__fileno;
824
 
static PyObject *__pyx_n_s__flags;
825
 
static PyObject *__pyx_n_s__getsockopt;
826
 
static PyObject *__pyx_n_s__handle;
827
 
static PyObject *__pyx_n_s__io_threads;
828
 
static PyObject *__pyx_n_s__items;
829
 
static PyObject *__pyx_n_s__json;
830
 
static PyObject *__pyx_n_s__loads;
831
 
static PyObject *__pyx_n_s__max_port;
832
 
static PyObject *__pyx_n_s__max_tries;
833
 
static PyObject *__pyx_n_s__min_port;
834
 
static PyObject *__pyx_n_s__modify;
835
 
static PyObject *__pyx_n_s__msg;
836
 
static PyObject *__pyx_n_s__msg_parts;
837
 
static PyObject *__pyx_n_s__obj;
838
 
static PyObject *__pyx_n_s__object;
839
 
static PyObject *__pyx_n_s__option;
840
 
static PyObject *__pyx_n_s__optval;
841
 
static PyObject *__pyx_n_s__pickle;
842
 
static PyObject *__pyx_n_s__poll;
843
 
static PyObject *__pyx_n_s__protocol;
844
 
static PyObject *__pyx_n_s__random;
845
 
static PyObject *__pyx_n_s__randrange;
846
 
static PyObject *__pyx_n_s__range;
847
 
static PyObject *__pyx_n_s__rcvmore;
848
 
static PyObject *__pyx_n_s__recv;
849
 
static PyObject *__pyx_n_s__register;
850
 
static PyObject *__pyx_n_s__revents;
851
 
static PyObject *__pyx_n_s__rlist;
852
 
static PyObject *__pyx_n_s__select;
853
 
static PyObject *__pyx_n_s__self;
854
 
static PyObject *__pyx_n_s__send;
855
 
static PyObject *__pyx_n_s__separators;
856
 
static PyObject *__pyx_n_s__simplejson;
857
 
static PyObject *__pyx_n_s__socket;
858
 
static PyObject *__pyx_n_s__socket_type;
859
 
static PyObject *__pyx_n_s__sockets;
860
 
static PyObject *__pyx_n_s__strerror;
861
 
static PyObject *__pyx_n_s__struct;
862
 
static PyObject *__pyx_n_s__timeout;
863
 
static PyObject *__pyx_n_s__unregister;
864
 
static PyObject *__pyx_n_s__wlist;
865
 
static PyObject *__pyx_n_s__xlist;
866
 
static PyObject *__pyx_n_s__zmq_msg;
867
 
static PyObject *__pyx_int_0;
868
 
static PyObject *__pyx_int_neg_1;
869
 
static PyObject *__pyx_int_100;
870
 
static PyObject *__pyx_int_2000;
871
 
static PyObject *__pyx_int_20000;
872
 
static PyObject *__pyx_k_5;
873
 
static PyObject *__pyx_k_6;
874
 
static PyObject *__pyx_k_7;
875
 
static PyObject *__pyx_k_8;
876
 
static PyObject *__pyx_k_14;
877
 
static PyObject *__pyx_k_15;
878
 
 
879
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":9
880
 
 * #---------------------------------------------------------------------
881
 
 * 
882
 
 * cdef inline void *memnew(size_t n):             # <<<<<<<<<<<<<<
883
 
 *     if n == 0: n = 1
884
 
 *     return malloc(n)
885
 
 */
886
 
 
887
 
static CYTHON_INLINE void *__pyx_f_3zmq_4_zmq_memnew(size_t __pyx_v_n) {
888
 
  void *__pyx_r;
889
 
  int __pyx_t_1;
890
 
  __Pyx_RefNannySetupContext("memnew");
891
 
 
892
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":10
893
 
 * 
894
 
 * cdef inline void *memnew(size_t n):
895
 
 *     if n == 0: n = 1             # <<<<<<<<<<<<<<
896
 
 *     return malloc(n)
897
 
 * 
898
 
 */
899
 
  __pyx_t_1 = (__pyx_v_n == 0);
900
 
  if (__pyx_t_1) {
901
 
    __pyx_v_n = 1;
902
 
    goto __pyx_L3;
903
 
  }
904
 
  __pyx_L3:;
905
 
 
906
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":11
907
 
 * cdef inline void *memnew(size_t n):
908
 
 *     if n == 0: n = 1
909
 
 *     return malloc(n)             # <<<<<<<<<<<<<<
910
 
 * 
911
 
 * cdef inline void memdel(void *p):
912
 
 */
913
 
  __pyx_r = malloc(__pyx_v_n);
914
 
  goto __pyx_L0;
915
 
 
916
 
  __pyx_r = 0;
917
 
  __pyx_L0:;
918
 
  __Pyx_RefNannyFinishContext();
919
 
  return __pyx_r;
920
 
}
921
 
 
922
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":13
923
 
 *     return malloc(n)
924
 
 * 
925
 
 * cdef inline void memdel(void *p):             # <<<<<<<<<<<<<<
926
 
 *     if p != NULL: free(p)
927
 
 * 
928
 
 */
929
 
 
930
 
static CYTHON_INLINE void __pyx_f_3zmq_4_zmq_memdel(void *__pyx_v_p) {
931
 
  int __pyx_t_1;
932
 
  __Pyx_RefNannySetupContext("memdel");
933
 
 
934
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":14
935
 
 * 
936
 
 * cdef inline void memdel(void *p):
937
 
 *     if p != NULL: free(p)             # <<<<<<<<<<<<<<
938
 
 * 
939
 
 * cdef inline object allocate(size_t n, void **pp):
940
 
 */
941
 
  __pyx_t_1 = (__pyx_v_p != NULL);
942
 
  if (__pyx_t_1) {
943
 
    free(__pyx_v_p);
944
 
    goto __pyx_L3;
945
 
  }
946
 
  __pyx_L3:;
947
 
 
948
 
  __Pyx_RefNannyFinishContext();
949
 
}
950
 
 
951
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":16
952
 
 *     if p != NULL: free(p)
953
 
 * 
954
 
 * cdef inline object allocate(size_t n, void **pp):             # <<<<<<<<<<<<<<
955
 
 *     cdef object cob
956
 
 *     cdef void *p = memnew(n)
957
 
 */
958
 
 
959
 
static CYTHON_INLINE PyObject *__pyx_f_3zmq_4_zmq_allocate(size_t __pyx_v_n, void **__pyx_v_pp) {
960
 
  PyObject *__pyx_v_cob;
961
 
  void *__pyx_v_p;
962
 
  PyObject *__pyx_r = NULL;
963
 
  int __pyx_t_1;
964
 
  PyObject *__pyx_t_2 = NULL;
965
 
  PyObject *__pyx_t_3 = NULL;
966
 
  PyObject *__pyx_t_4 = NULL;
967
 
  __Pyx_RefNannySetupContext("allocate");
968
 
  __pyx_v_cob = Py_None; __Pyx_INCREF(Py_None);
969
 
 
970
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":18
971
 
 * cdef inline object allocate(size_t n, void **pp):
972
 
 *     cdef object cob
973
 
 *     cdef void *p = memnew(n)             # <<<<<<<<<<<<<<
974
 
 *     if p == NULL: raise MemoryError
975
 
 *     try:    cob = PyCObject_FromVoidPtr(p, memdel)
976
 
 */
977
 
  __pyx_v_p = __pyx_f_3zmq_4_zmq_memnew(__pyx_v_n);
978
 
 
979
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":19
980
 
 *     cdef object cob
981
 
 *     cdef void *p = memnew(n)
982
 
 *     if p == NULL: raise MemoryError             # <<<<<<<<<<<<<<
983
 
 *     try:    cob = PyCObject_FromVoidPtr(p, memdel)
984
 
 *     except: memdel(p); raise
985
 
 */
986
 
  __pyx_t_1 = (__pyx_v_p == NULL);
987
 
  if (__pyx_t_1) {
988
 
    __Pyx_Raise(__pyx_builtin_MemoryError, 0, 0);
989
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
990
 
    goto __pyx_L3;
991
 
  }
992
 
  __pyx_L3:;
993
 
 
994
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":20
995
 
 *     cdef void *p = memnew(n)
996
 
 *     if p == NULL: raise MemoryError
997
 
 *     try:    cob = PyCObject_FromVoidPtr(p, memdel)             # <<<<<<<<<<<<<<
998
 
 *     except: memdel(p); raise
999
 
 *     pp[0] = p
1000
 
 */
1001
 
  {
1002
 
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
1003
 
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
1004
 
    __Pyx_XGOTREF(__pyx_save_exc_type);
1005
 
    __Pyx_XGOTREF(__pyx_save_exc_value);
1006
 
    __Pyx_XGOTREF(__pyx_save_exc_tb);
1007
 
    /*try:*/ {
1008
 
      __pyx_t_2 = PyCObject_FromVoidPtr(__pyx_v_p, __pyx_f_3zmq_4_zmq_memdel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
1009
 
      __Pyx_GOTREF(__pyx_t_2);
1010
 
      __Pyx_DECREF(__pyx_v_cob);
1011
 
      __pyx_v_cob = __pyx_t_2;
1012
 
      __pyx_t_2 = 0;
1013
 
    }
1014
 
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
1015
 
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
1016
 
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
1017
 
    goto __pyx_L11_try_end;
1018
 
    __pyx_L4_error:;
1019
 
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
1020
 
 
1021
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":21
1022
 
 *     if p == NULL: raise MemoryError
1023
 
 *     try:    cob = PyCObject_FromVoidPtr(p, memdel)
1024
 
 *     except: memdel(p); raise             # <<<<<<<<<<<<<<
1025
 
 *     pp[0] = p
1026
 
 *     return cob
1027
 
 */
1028
 
    /*except:*/ {
1029
 
      __Pyx_AddTraceback("zmq._zmq.allocate");
1030
 
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
1031
 
      __Pyx_GOTREF(__pyx_t_2);
1032
 
      __Pyx_GOTREF(__pyx_t_3);
1033
 
      __Pyx_GOTREF(__pyx_t_4);
1034
 
      __pyx_f_3zmq_4_zmq_memdel(__pyx_v_p);
1035
 
      __Pyx_GIVEREF(__pyx_t_2);
1036
 
      __Pyx_GIVEREF(__pyx_t_3);
1037
 
      __Pyx_GIVEREF(__pyx_t_4);
1038
 
      __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_4);
1039
 
      __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; 
1040
 
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
1041
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1042
 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1043
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1044
 
      goto __pyx_L5_exception_handled;
1045
 
    }
1046
 
    __pyx_L6_except_error:;
1047
 
    __Pyx_XGIVEREF(__pyx_save_exc_type);
1048
 
    __Pyx_XGIVEREF(__pyx_save_exc_value);
1049
 
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
1050
 
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
1051
 
    goto __pyx_L1_error;
1052
 
    __pyx_L5_exception_handled:;
1053
 
    __Pyx_XGIVEREF(__pyx_save_exc_type);
1054
 
    __Pyx_XGIVEREF(__pyx_save_exc_value);
1055
 
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
1056
 
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
1057
 
    __pyx_L11_try_end:;
1058
 
  }
1059
 
 
1060
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":22
1061
 
 *     try:    cob = PyCObject_FromVoidPtr(p, memdel)
1062
 
 *     except: memdel(p); raise
1063
 
 *     pp[0] = p             # <<<<<<<<<<<<<<
1064
 
 *     return cob
1065
 
 */
1066
 
  (__pyx_v_pp[0]) = __pyx_v_p;
1067
 
 
1068
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/allocate.pxi":23
1069
 
 *     except: memdel(p); raise
1070
 
 *     pp[0] = p
1071
 
 *     return cob             # <<<<<<<<<<<<<<
1072
 
 */
1073
 
  __Pyx_XDECREF(__pyx_r);
1074
 
  __Pyx_INCREF(__pyx_v_cob);
1075
 
  __pyx_r = __pyx_v_cob;
1076
 
  goto __pyx_L0;
1077
 
 
1078
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1079
 
  goto __pyx_L0;
1080
 
  __pyx_L1_error:;
1081
 
  __Pyx_XDECREF(__pyx_t_2);
1082
 
  __Pyx_XDECREF(__pyx_t_3);
1083
 
  __Pyx_XDECREF(__pyx_t_4);
1084
 
  __Pyx_AddTraceback("zmq._zmq.allocate");
1085
 
  __pyx_r = 0;
1086
 
  __pyx_L0:;
1087
 
  __Pyx_DECREF(__pyx_v_cob);
1088
 
  __Pyx_XGIVEREF(__pyx_r);
1089
 
  __Pyx_RefNannyFinishContext();
1090
 
  return __pyx_r;
1091
 
}
1092
 
 
1093
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":224
1094
 
 * 
1095
 
 * 
1096
 
 * def strerror(errnum):             # <<<<<<<<<<<<<<
1097
 
 *     """Return the error string given the error number."""
1098
 
 *     return zmq_strerror(errnum)
1099
 
 */
1100
 
 
1101
 
static PyObject *__pyx_pf_3zmq_4_zmq_strerror(PyObject *__pyx_self, PyObject *__pyx_v_errnum); /*proto*/
1102
 
static char __pyx_doc_3zmq_4_zmq_strerror[] = "Return the error string given the error number.";
1103
 
static PyObject *__pyx_pf_3zmq_4_zmq_strerror(PyObject *__pyx_self, PyObject *__pyx_v_errnum) {
1104
 
  PyObject *__pyx_r = NULL;
1105
 
  int __pyx_t_1;
1106
 
  PyObject *__pyx_t_2 = NULL;
1107
 
  __Pyx_RefNannySetupContext("strerror");
1108
 
  __pyx_self = __pyx_self;
1109
 
 
1110
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":226
1111
 
 * def strerror(errnum):
1112
 
 *     """Return the error string given the error number."""
1113
 
 *     return zmq_strerror(errnum)             # <<<<<<<<<<<<<<
1114
 
 * 
1115
 
 * class ZMQBaseError(Exception):
1116
 
 */
1117
 
  __Pyx_XDECREF(__pyx_r);
1118
 
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_errnum); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1119
 
  __pyx_t_2 = __Pyx_PyBytes_FromString(zmq_strerror(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1120
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1121
 
  __pyx_r = ((PyObject *)__pyx_t_2);
1122
 
  __pyx_t_2 = 0;
1123
 
  goto __pyx_L0;
1124
 
 
1125
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1126
 
  goto __pyx_L0;
1127
 
  __pyx_L1_error:;
1128
 
  __Pyx_XDECREF(__pyx_t_2);
1129
 
  __Pyx_AddTraceback("zmq._zmq.strerror");
1130
 
  __pyx_r = NULL;
1131
 
  __pyx_L0:;
1132
 
  __Pyx_XGIVEREF(__pyx_r);
1133
 
  __Pyx_RefNannyFinishContext();
1134
 
  return __pyx_r;
1135
 
}
1136
 
 
1137
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":234
1138
 
 *     """Base exception class for 0MQ errors in Python."""
1139
 
 * 
1140
 
 *     def __init__(self, error=None):             # <<<<<<<<<<<<<<
1141
 
 *         """Wrap an errno style error.
1142
 
 * 
1143
 
 */
1144
 
 
1145
 
static PyObject *__pyx_pf_3zmq_4_zmq_8ZMQError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1146
 
static char __pyx_doc_3zmq_4_zmq_8ZMQError___init__[] = "Wrap an errno style error.\n\n        Parameters\n        ----------\n        error : int\n            The ZMQ errno or None.  If None, then zmq_errno() is called and\n            used.\n        ";
1147
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_8ZMQError___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_3zmq_4_zmq_8ZMQError___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_8ZMQError___init__)};
1148
 
static PyObject *__pyx_pf_3zmq_4_zmq_8ZMQError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1149
 
  PyObject *__pyx_v_self = 0;
1150
 
  PyObject *__pyx_v_error = 0;
1151
 
  PyObject *__pyx_r = NULL;
1152
 
  int __pyx_t_1;
1153
 
  PyObject *__pyx_t_2 = NULL;
1154
 
  PyObject *__pyx_t_3 = NULL;
1155
 
  PyObject *__pyx_t_4 = NULL;
1156
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__error,0};
1157
 
  __Pyx_RefNannySetupContext("__init__");
1158
 
  __pyx_self = __pyx_self;
1159
 
  if (unlikely(__pyx_kwds)) {
1160
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1161
 
    PyObject* values[2] = {0,0};
1162
 
    values[1] = ((PyObject *)Py_None);
1163
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
1164
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1165
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1166
 
      case  0: break;
1167
 
      default: goto __pyx_L5_argtuple_error;
1168
 
    }
1169
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
1170
 
      case  0:
1171
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
1172
 
      if (likely(values[0])) kw_args--;
1173
 
      else goto __pyx_L5_argtuple_error;
1174
 
      case  1:
1175
 
      if (kw_args > 0) {
1176
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__error);
1177
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
1178
 
      }
1179
 
    }
1180
 
    if (unlikely(kw_args > 0)) {
1181
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1182
 
    }
1183
 
    __pyx_v_self = values[0];
1184
 
    __pyx_v_error = values[1];
1185
 
  } else {
1186
 
    __pyx_v_error = ((PyObject *)Py_None);
1187
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
1188
 
      case  2: __pyx_v_error = PyTuple_GET_ITEM(__pyx_args, 1);
1189
 
      case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
1190
 
      break;
1191
 
      default: goto __pyx_L5_argtuple_error;
1192
 
    }
1193
 
  }
1194
 
  goto __pyx_L4_argument_unpacking_done;
1195
 
  __pyx_L5_argtuple_error:;
1196
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1197
 
  __pyx_L3_error:;
1198
 
  __Pyx_AddTraceback("zmq._zmq.ZMQError.__init__");
1199
 
  return NULL;
1200
 
  __pyx_L4_argument_unpacking_done:;
1201
 
  __Pyx_INCREF(__pyx_v_self);
1202
 
  __Pyx_INCREF(__pyx_v_error);
1203
 
 
1204
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":243
1205
 
 *             used.
1206
 
 *         """
1207
 
 *         if error is None:             # <<<<<<<<<<<<<<
1208
 
 *             error = zmq_errno()
1209
 
 *         if type(error) == int:
1210
 
 */
1211
 
  __pyx_t_1 = (__pyx_v_error == Py_None);
1212
 
  if (__pyx_t_1) {
1213
 
 
1214
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":244
1215
 
 *         """
1216
 
 *         if error is None:
1217
 
 *             error = zmq_errno()             # <<<<<<<<<<<<<<
1218
 
 *         if type(error) == int:
1219
 
 *             self.errstr = strerror(error)
1220
 
 */
1221
 
    __pyx_t_2 = PyInt_FromLong(zmq_errno()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1222
 
    __Pyx_GOTREF(__pyx_t_2);
1223
 
    __Pyx_DECREF(__pyx_v_error);
1224
 
    __pyx_v_error = __pyx_t_2;
1225
 
    __pyx_t_2 = 0;
1226
 
    goto __pyx_L6;
1227
 
  }
1228
 
  __pyx_L6:;
1229
 
 
1230
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":245
1231
 
 *         if error is None:
1232
 
 *             error = zmq_errno()
1233
 
 *         if type(error) == int:             # <<<<<<<<<<<<<<
1234
 
 *             self.errstr = strerror(error)
1235
 
 *             self.errno = error
1236
 
 */
1237
 
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_error)), ((PyObject *)((PyObject*)&PyInt_Type)), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1238
 
  __Pyx_GOTREF(__pyx_t_2);
1239
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1240
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1241
 
  if (__pyx_t_1) {
1242
 
 
1243
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":246
1244
 
 *             error = zmq_errno()
1245
 
 *         if type(error) == int:
1246
 
 *             self.errstr = strerror(error)             # <<<<<<<<<<<<<<
1247
 
 *             self.errno = error
1248
 
 *         else:
1249
 
 */
1250
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__strerror); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1251
 
    __Pyx_GOTREF(__pyx_t_2);
1252
 
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1253
 
    __Pyx_GOTREF(__pyx_t_3);
1254
 
    __Pyx_INCREF(__pyx_v_error);
1255
 
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_error);
1256
 
    __Pyx_GIVEREF(__pyx_v_error);
1257
 
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1258
 
    __Pyx_GOTREF(__pyx_t_4);
1259
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1260
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1261
 
    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__errstr, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1262
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1263
 
 
1264
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":247
1265
 
 *         if type(error) == int:
1266
 
 *             self.errstr = strerror(error)
1267
 
 *             self.errno = error             # <<<<<<<<<<<<<<
1268
 
 *         else:
1269
 
 *             self.errstr = str(error)
1270
 
 */
1271
 
    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__errno, __pyx_v_error) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1272
 
    goto __pyx_L7;
1273
 
  }
1274
 
  /*else*/ {
1275
 
 
1276
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":249
1277
 
 *             self.errno = error
1278
 
 *         else:
1279
 
 *             self.errstr = str(error)             # <<<<<<<<<<<<<<
1280
 
 *             self.errno = None
1281
 
 * 
1282
 
 */
1283
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1284
 
    __Pyx_GOTREF(__pyx_t_4);
1285
 
    __Pyx_INCREF(__pyx_v_error);
1286
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_error);
1287
 
    __Pyx_GIVEREF(__pyx_v_error);
1288
 
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1289
 
    __Pyx_GOTREF(__pyx_t_3);
1290
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1291
 
    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__errstr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1292
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1293
 
 
1294
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":250
1295
 
 *         else:
1296
 
 *             self.errstr = str(error)
1297
 
 *             self.errno = None             # <<<<<<<<<<<<<<
1298
 
 * 
1299
 
 *     def __str__(self):
1300
 
 */
1301
 
    if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__errno, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1302
 
  }
1303
 
  __pyx_L7:;
1304
 
 
1305
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1306
 
  goto __pyx_L0;
1307
 
  __pyx_L1_error:;
1308
 
  __Pyx_XDECREF(__pyx_t_2);
1309
 
  __Pyx_XDECREF(__pyx_t_3);
1310
 
  __Pyx_XDECREF(__pyx_t_4);
1311
 
  __Pyx_AddTraceback("zmq._zmq.ZMQError.__init__");
1312
 
  __pyx_r = NULL;
1313
 
  __pyx_L0:;
1314
 
  __Pyx_DECREF(__pyx_v_self);
1315
 
  __Pyx_DECREF(__pyx_v_error);
1316
 
  __Pyx_XGIVEREF(__pyx_r);
1317
 
  __Pyx_RefNannyFinishContext();
1318
 
  return __pyx_r;
1319
 
}
1320
 
 
1321
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":252
1322
 
 *             self.errno = None
1323
 
 * 
1324
 
 *     def __str__(self):             # <<<<<<<<<<<<<<
1325
 
 *         return self.errstr
1326
 
 * 
1327
 
 */
1328
 
 
1329
 
static PyObject *__pyx_pf_3zmq_4_zmq_8ZMQError___str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
1330
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_8ZMQError___str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_3zmq_4_zmq_8ZMQError___str__, METH_O, __Pyx_DOCSTR(0)};
1331
 
static PyObject *__pyx_pf_3zmq_4_zmq_8ZMQError___str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
1332
 
  PyObject *__pyx_r = NULL;
1333
 
  PyObject *__pyx_t_1 = NULL;
1334
 
  __Pyx_RefNannySetupContext("__str__");
1335
 
  __pyx_self = __pyx_self;
1336
 
 
1337
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":253
1338
 
 * 
1339
 
 *     def __str__(self):
1340
 
 *         return self.errstr             # <<<<<<<<<<<<<<
1341
 
 * 
1342
 
 * class ZMQBindError(ZMQBaseError):
1343
 
 */
1344
 
  __Pyx_XDECREF(__pyx_r);
1345
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__errstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1346
 
  __Pyx_GOTREF(__pyx_t_1);
1347
 
  __pyx_r = __pyx_t_1;
1348
 
  __pyx_t_1 = 0;
1349
 
  goto __pyx_L0;
1350
 
 
1351
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1352
 
  goto __pyx_L0;
1353
 
  __pyx_L1_error:;
1354
 
  __Pyx_XDECREF(__pyx_t_1);
1355
 
  __Pyx_AddTraceback("zmq._zmq.ZMQError.__str__");
1356
 
  __pyx_r = NULL;
1357
 
  __pyx_L0:;
1358
 
  __Pyx_XGIVEREF(__pyx_r);
1359
 
  __Pyx_RefNannyFinishContext();
1360
 
  return __pyx_r;
1361
 
}
1362
 
 
1363
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":264
1364
 
 * 
1365
 
 * 
1366
 
 * cdef void free_python_msg(void *data, void *hint) with gil:             # <<<<<<<<<<<<<<
1367
 
 *     """A function for DECREF'ing Python based messages."""
1368
 
 *     if hint != NULL:
1369
 
 */
1370
 
 
1371
 
static  void __pyx_f_3zmq_4_zmq_free_python_msg(void *__pyx_v_data, void *__pyx_v_hint) {
1372
 
  int __pyx_t_1;
1373
 
  PyGILState_STATE _save = PyGILState_Ensure();
1374
 
  __Pyx_RefNannySetupContext("free_python_msg");
1375
 
 
1376
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":266
1377
 
 * cdef void free_python_msg(void *data, void *hint) with gil:
1378
 
 *     """A function for DECREF'ing Python based messages."""
1379
 
 *     if hint != NULL:             # <<<<<<<<<<<<<<
1380
 
 *         Py_DECREF(<object>hint)
1381
 
 * 
1382
 
 */
1383
 
  __pyx_t_1 = (__pyx_v_hint != NULL);
1384
 
  if (__pyx_t_1) {
1385
 
 
1386
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":267
1387
 
 *     """A function for DECREF'ing Python based messages."""
1388
 
 *     if hint != NULL:
1389
 
 *         Py_DECREF(<object>hint)             # <<<<<<<<<<<<<<
1390
 
 * 
1391
 
 * 
1392
 
 */
1393
 
    Py_DECREF(((PyObject *)__pyx_v_hint));
1394
 
    goto __pyx_L3;
1395
 
  }
1396
 
  __pyx_L3:;
1397
 
 
1398
 
  __Pyx_RefNannyFinishContext();
1399
 
  PyGILState_Release(_save);
1400
 
}
1401
 
 
1402
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":286
1403
 
 *     cdef object data
1404
 
 * 
1405
 
 *     def __cinit__(self, object data=None):             # <<<<<<<<<<<<<<
1406
 
 *         cdef int rc
1407
 
 *         # Save the data object in case the user wants the the data as a str.
1408
 
 */
1409
 
 
1410
 
static int __pyx_pf_3zmq_4_zmq_7Message___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1411
 
static int __pyx_pf_3zmq_4_zmq_7Message___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1412
 
  PyObject *__pyx_v_data = 0;
1413
 
  int __pyx_v_rc;
1414
 
  char *__pyx_v_data_c;
1415
 
  Py_ssize_t __pyx_v_data_len_c;
1416
 
  int __pyx_r;
1417
 
  int __pyx_t_1;
1418
 
  PyObject *__pyx_t_2 = NULL;
1419
 
  PyObject *__pyx_t_3 = NULL;
1420
 
  int __pyx_t_4;
1421
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,0};
1422
 
  __Pyx_RefNannySetupContext("__cinit__");
1423
 
  if (unlikely(__pyx_kwds)) {
1424
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
1425
 
    PyObject* values[1] = {0};
1426
 
    values[0] = ((PyObject *)Py_None);
1427
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
1428
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1429
 
      case  0: break;
1430
 
      default: goto __pyx_L5_argtuple_error;
1431
 
    }
1432
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
1433
 
      case  0:
1434
 
      if (kw_args > 1) {
1435
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
1436
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
1437
 
      }
1438
 
    }
1439
 
    if (unlikely(kw_args > 0)) {
1440
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1441
 
    }
1442
 
    __pyx_v_data = values[0];
1443
 
  } else {
1444
 
    __pyx_v_data = ((PyObject *)Py_None);
1445
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
1446
 
      case  1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
1447
 
      case  0: break;
1448
 
      default: goto __pyx_L5_argtuple_error;
1449
 
    }
1450
 
  }
1451
 
  goto __pyx_L4_argument_unpacking_done;
1452
 
  __pyx_L5_argtuple_error:;
1453
 
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1454
 
  __pyx_L3_error:;
1455
 
  __Pyx_AddTraceback("zmq._zmq.Message.__cinit__");
1456
 
  return -1;
1457
 
  __pyx_L4_argument_unpacking_done:;
1458
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1459
 
  __Pyx_INCREF(__pyx_v_data);
1460
 
 
1461
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":289
1462
 
 *         cdef int rc
1463
 
 *         # Save the data object in case the user wants the the data as a str.
1464
 
 *         self.data = data             # <<<<<<<<<<<<<<
1465
 
 *         cdef char *data_c = NULL
1466
 
 *         cdef Py_ssize_t data_len_c
1467
 
 */
1468
 
  __Pyx_INCREF(__pyx_v_data);
1469
 
  __Pyx_GIVEREF(__pyx_v_data);
1470
 
  __Pyx_GOTREF(((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->data);
1471
 
  __Pyx_DECREF(((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->data);
1472
 
  ((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->data = __pyx_v_data;
1473
 
 
1474
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":290
1475
 
 *         # Save the data object in case the user wants the the data as a str.
1476
 
 *         self.data = data
1477
 
 *         cdef char *data_c = NULL             # <<<<<<<<<<<<<<
1478
 
 *         cdef Py_ssize_t data_len_c
1479
 
 * 
1480
 
 */
1481
 
  __pyx_v_data_c = NULL;
1482
 
 
1483
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":293
1484
 
 *         cdef Py_ssize_t data_len_c
1485
 
 * 
1486
 
 *         if data is None:             # <<<<<<<<<<<<<<
1487
 
 *             with nogil:
1488
 
 *                 rc = zmq_msg_init(&self.zmq_msg)
1489
 
 */
1490
 
  __pyx_t_1 = (__pyx_v_data == Py_None);
1491
 
  if (__pyx_t_1) {
1492
 
 
1493
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":294
1494
 
 * 
1495
 
 *         if data is None:
1496
 
 *             with nogil:             # <<<<<<<<<<<<<<
1497
 
 *                 rc = zmq_msg_init(&self.zmq_msg)
1498
 
 *             if rc != 0:
1499
 
 */
1500
 
    { PyThreadState *_save;
1501
 
      Py_UNBLOCK_THREADS
1502
 
      /*try:*/ {
1503
 
 
1504
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":295
1505
 
 *         if data is None:
1506
 
 *             with nogil:
1507
 
 *                 rc = zmq_msg_init(&self.zmq_msg)             # <<<<<<<<<<<<<<
1508
 
 *             if rc != 0:
1509
 
 *                 raise ZMQError()
1510
 
 */
1511
 
        __pyx_v_rc = zmq_msg_init((&((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->zmq_msg));
1512
 
      }
1513
 
      /*finally:*/ {
1514
 
 
1515
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":294
1516
 
 * 
1517
 
 *         if data is None:
1518
 
 *             with nogil:             # <<<<<<<<<<<<<<
1519
 
 *                 rc = zmq_msg_init(&self.zmq_msg)
1520
 
 *             if rc != 0:
1521
 
 */
1522
 
        Py_BLOCK_THREADS
1523
 
      }
1524
 
    }
1525
 
 
1526
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":296
1527
 
 *             with nogil:
1528
 
 *                 rc = zmq_msg_init(&self.zmq_msg)
1529
 
 *             if rc != 0:             # <<<<<<<<<<<<<<
1530
 
 *                 raise ZMQError()
1531
 
 *         else:
1532
 
 */
1533
 
    __pyx_t_1 = (__pyx_v_rc != 0);
1534
 
    if (__pyx_t_1) {
1535
 
 
1536
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":297
1537
 
 *                 rc = zmq_msg_init(&self.zmq_msg)
1538
 
 *             if rc != 0:
1539
 
 *                 raise ZMQError()             # <<<<<<<<<<<<<<
1540
 
 *         else:
1541
 
 *             PyString_AsStringAndSize(data, &data_c, &data_len_c)
1542
 
 */
1543
 
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1544
 
      __Pyx_GOTREF(__pyx_t_2);
1545
 
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1546
 
      __Pyx_GOTREF(__pyx_t_3);
1547
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1548
 
      __Pyx_Raise(__pyx_t_3, 0, 0);
1549
 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1550
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1551
 
      goto __pyx_L10;
1552
 
    }
1553
 
    __pyx_L10:;
1554
 
    goto __pyx_L6;
1555
 
  }
1556
 
  /*else*/ {
1557
 
 
1558
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":299
1559
 
 *                 raise ZMQError()
1560
 
 *         else:
1561
 
 *             PyString_AsStringAndSize(data, &data_c, &data_len_c)             # <<<<<<<<<<<<<<
1562
 
 *             # We INCREF the *original* Python object (not self) and pass it
1563
 
 *             # as the hint below. This allows other copies of this Message
1564
 
 */
1565
 
    __pyx_t_4 = PyString_AsStringAndSize(__pyx_v_data, (&__pyx_v_data_c), (&__pyx_v_data_len_c)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1566
 
 
1567
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":303
1568
 
 *             # as the hint below. This allows other copies of this Message
1569
 
 *             # object to take over the ref counting of data properly.
1570
 
 *             Py_INCREF(data)             # <<<<<<<<<<<<<<
1571
 
 *             with nogil:
1572
 
 *                 rc = zmq_msg_init_data(
1573
 
 */
1574
 
    Py_INCREF(__pyx_v_data);
1575
 
 
1576
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":304
1577
 
 *             # object to take over the ref counting of data properly.
1578
 
 *             Py_INCREF(data)
1579
 
 *             with nogil:             # <<<<<<<<<<<<<<
1580
 
 *                 rc = zmq_msg_init_data(
1581
 
 *                     &self.zmq_msg, <void *>data_c, data_len_c,
1582
 
 */
1583
 
    { PyThreadState *_save;
1584
 
      Py_UNBLOCK_THREADS
1585
 
      /*try:*/ {
1586
 
 
1587
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":308
1588
 
 *                     &self.zmq_msg, <void *>data_c, data_len_c,
1589
 
 *                     <zmq_free_fn *>free_python_msg, <void *>data
1590
 
 *                 )             # <<<<<<<<<<<<<<
1591
 
 *             if rc != 0:
1592
 
 *                 Py_DECREF(data)
1593
 
 */
1594
 
        __pyx_v_rc = zmq_msg_init_data((&((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->zmq_msg), ((void *)__pyx_v_data_c), __pyx_v_data_len_c, ((zmq_free_fn *)__pyx_f_3zmq_4_zmq_free_python_msg), ((void *)__pyx_v_data));
1595
 
      }
1596
 
      /*finally:*/ {
1597
 
 
1598
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":304
1599
 
 *             # object to take over the ref counting of data properly.
1600
 
 *             Py_INCREF(data)
1601
 
 *             with nogil:             # <<<<<<<<<<<<<<
1602
 
 *                 rc = zmq_msg_init_data(
1603
 
 *                     &self.zmq_msg, <void *>data_c, data_len_c,
1604
 
 */
1605
 
        Py_BLOCK_THREADS
1606
 
      }
1607
 
    }
1608
 
 
1609
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":309
1610
 
 *                     <zmq_free_fn *>free_python_msg, <void *>data
1611
 
 *                 )
1612
 
 *             if rc != 0:             # <<<<<<<<<<<<<<
1613
 
 *                 Py_DECREF(data)
1614
 
 *                 raise ZMQError()
1615
 
 */
1616
 
    __pyx_t_1 = (__pyx_v_rc != 0);
1617
 
    if (__pyx_t_1) {
1618
 
 
1619
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":310
1620
 
 *                 )
1621
 
 *             if rc != 0:
1622
 
 *                 Py_DECREF(data)             # <<<<<<<<<<<<<<
1623
 
 *                 raise ZMQError()
1624
 
 * 
1625
 
 */
1626
 
      Py_DECREF(__pyx_v_data);
1627
 
 
1628
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":311
1629
 
 *             if rc != 0:
1630
 
 *                 Py_DECREF(data)
1631
 
 *                 raise ZMQError()             # <<<<<<<<<<<<<<
1632
 
 * 
1633
 
 *     def __dealloc__(self):
1634
 
 */
1635
 
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1636
 
      __Pyx_GOTREF(__pyx_t_3);
1637
 
      __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1638
 
      __Pyx_GOTREF(__pyx_t_2);
1639
 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1640
 
      __Pyx_Raise(__pyx_t_2, 0, 0);
1641
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1642
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1643
 
      goto __pyx_L14;
1644
 
    }
1645
 
    __pyx_L14:;
1646
 
  }
1647
 
  __pyx_L6:;
1648
 
 
1649
 
  __pyx_r = 0;
1650
 
  goto __pyx_L0;
1651
 
  __pyx_L1_error:;
1652
 
  __Pyx_XDECREF(__pyx_t_2);
1653
 
  __Pyx_XDECREF(__pyx_t_3);
1654
 
  __Pyx_AddTraceback("zmq._zmq.Message.__cinit__");
1655
 
  __pyx_r = -1;
1656
 
  __pyx_L0:;
1657
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1658
 
  __Pyx_DECREF(__pyx_v_data);
1659
 
  __Pyx_RefNannyFinishContext();
1660
 
  return __pyx_r;
1661
 
}
1662
 
 
1663
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":313
1664
 
 *                 raise ZMQError()
1665
 
 * 
1666
 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
1667
 
 *         cdef int rc
1668
 
 *         # This simply decreases the 0MQ ref-count of zmq_msg.
1669
 
 */
1670
 
 
1671
 
static void __pyx_pf_3zmq_4_zmq_7Message___dealloc__(PyObject *__pyx_v_self); /*proto*/
1672
 
static void __pyx_pf_3zmq_4_zmq_7Message___dealloc__(PyObject *__pyx_v_self) {
1673
 
  int __pyx_v_rc;
1674
 
  int __pyx_t_1;
1675
 
  PyObject *__pyx_t_2 = NULL;
1676
 
  PyObject *__pyx_t_3 = NULL;
1677
 
  __Pyx_RefNannySetupContext("__dealloc__");
1678
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1679
 
 
1680
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":316
1681
 
 *         cdef int rc
1682
 
 *         # This simply decreases the 0MQ ref-count of zmq_msg.
1683
 
 *         rc = zmq_msg_close(&self.zmq_msg)             # <<<<<<<<<<<<<<
1684
 
 *         if rc != 0:
1685
 
 *             raise ZMQError()
1686
 
 */
1687
 
  __pyx_v_rc = zmq_msg_close((&((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->zmq_msg));
1688
 
 
1689
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":317
1690
 
 *         # This simply decreases the 0MQ ref-count of zmq_msg.
1691
 
 *         rc = zmq_msg_close(&self.zmq_msg)
1692
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
1693
 
 *             raise ZMQError()
1694
 
 * 
1695
 
 */
1696
 
  __pyx_t_1 = (__pyx_v_rc != 0);
1697
 
  if (__pyx_t_1) {
1698
 
 
1699
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":318
1700
 
 *         rc = zmq_msg_close(&self.zmq_msg)
1701
 
 *         if rc != 0:
1702
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
1703
 
 * 
1704
 
 *     def __copy__(self):
1705
 
 */
1706
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1707
 
    __Pyx_GOTREF(__pyx_t_2);
1708
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1709
 
    __Pyx_GOTREF(__pyx_t_3);
1710
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1711
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
1712
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1713
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1714
 
    goto __pyx_L5;
1715
 
  }
1716
 
  __pyx_L5:;
1717
 
 
1718
 
  goto __pyx_L0;
1719
 
  __pyx_L1_error:;
1720
 
  __Pyx_XDECREF(__pyx_t_2);
1721
 
  __Pyx_XDECREF(__pyx_t_3);
1722
 
  __Pyx_AddTraceback("zmq._zmq.Message.__dealloc__");
1723
 
  __pyx_L0:;
1724
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1725
 
  __Pyx_RefNannyFinishContext();
1726
 
}
1727
 
 
1728
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":320
1729
 
 *             raise ZMQError()
1730
 
 * 
1731
 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
1732
 
 *         """Create a shallow copy of the message.
1733
 
 * 
1734
 
 */
1735
 
 
1736
 
static PyObject *__pyx_pf_3zmq_4_zmq_7Message___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
1737
 
static char __pyx_doc_3zmq_4_zmq_7Message___copy__[] = "Create a shallow copy of the message.\n\n        This does not copy the contents of the Message, just the pointer.\n        This will increment the 0MQ ref count of the message, but not\n        the ref count of the Python object. That is only done once when\n        the Python is first turned into a 0MQ message.\n        ";
1738
 
static PyObject *__pyx_pf_3zmq_4_zmq_7Message___copy__(PyObject *__pyx_v_self, PyObject *unused) {
1739
 
  PyObject *__pyx_r = NULL;
1740
 
  PyObject *__pyx_t_1 = NULL;
1741
 
  __Pyx_RefNannySetupContext("__copy__");
1742
 
 
1743
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":328
1744
 
 *         the Python is first turned into a 0MQ message.
1745
 
 *         """
1746
 
 *         return self.fast_copy()             # <<<<<<<<<<<<<<
1747
 
 * 
1748
 
 *     cdef Message fast_copy(self):
1749
 
 */
1750
 
  __Pyx_XDECREF(__pyx_r);
1751
 
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3zmq_4_zmq_Message *)((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->__pyx_vtab)->fast_copy(((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1752
 
  __Pyx_GOTREF(__pyx_t_1);
1753
 
  __pyx_r = __pyx_t_1;
1754
 
  __pyx_t_1 = 0;
1755
 
  goto __pyx_L0;
1756
 
 
1757
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1758
 
  goto __pyx_L0;
1759
 
  __pyx_L1_error:;
1760
 
  __Pyx_XDECREF(__pyx_t_1);
1761
 
  __Pyx_AddTraceback("zmq._zmq.Message.__copy__");
1762
 
  __pyx_r = NULL;
1763
 
  __pyx_L0:;
1764
 
  __Pyx_XGIVEREF(__pyx_r);
1765
 
  __Pyx_RefNannyFinishContext();
1766
 
  return __pyx_r;
1767
 
}
1768
 
 
1769
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":330
1770
 
 *         return self.fast_copy()
1771
 
 * 
1772
 
 *     cdef Message fast_copy(self):             # <<<<<<<<<<<<<<
1773
 
 *         """Fast, cdef'd version of shallow copy of the message."""
1774
 
 *         cdef Message new_msg
1775
 
 */
1776
 
 
1777
 
static  struct __pyx_obj_3zmq_4_zmq_Message *__pyx_f_3zmq_4_zmq_7Message_fast_copy(struct __pyx_obj_3zmq_4_zmq_Message *__pyx_v_self) {
1778
 
  struct __pyx_obj_3zmq_4_zmq_Message *__pyx_v_new_msg;
1779
 
  struct __pyx_obj_3zmq_4_zmq_Message *__pyx_r = NULL;
1780
 
  PyObject *__pyx_t_1 = NULL;
1781
 
  int __pyx_t_2;
1782
 
  __Pyx_RefNannySetupContext("fast_copy");
1783
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1784
 
  __pyx_v_new_msg = ((struct __pyx_obj_3zmq_4_zmq_Message *)Py_None); __Pyx_INCREF(Py_None);
1785
 
 
1786
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":333
1787
 
 *         """Fast, cdef'd version of shallow copy of the message."""
1788
 
 *         cdef Message new_msg
1789
 
 *         new_msg = Message()             # <<<<<<<<<<<<<<
1790
 
 *         # This does not copy the contents, but just increases the ref-count
1791
 
 *         # of the zmq_msg by one.
1792
 
 */
1793
 
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3zmq_4_zmq_Message)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1794
 
  __Pyx_GOTREF(__pyx_t_1);
1795
 
  __Pyx_DECREF(((PyObject *)__pyx_v_new_msg));
1796
 
  __pyx_v_new_msg = ((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_t_1);
1797
 
  __pyx_t_1 = 0;
1798
 
 
1799
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":336
1800
 
 *         # This does not copy the contents, but just increases the ref-count
1801
 
 *         # of the zmq_msg by one.
1802
 
 *         zmq_msg_copy(&new_msg.zmq_msg, &self.zmq_msg)             # <<<<<<<<<<<<<<
1803
 
 *         # Copy the ref to data so the copy won't create a copy when str is
1804
 
 *         # called.
1805
 
 */
1806
 
  zmq_msg_copy((&__pyx_v_new_msg->zmq_msg), (&__pyx_v_self->zmq_msg));
1807
 
 
1808
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":339
1809
 
 *         # Copy the ref to data so the copy won't create a copy when str is
1810
 
 *         # called.
1811
 
 *         if self.data is not None:             # <<<<<<<<<<<<<<
1812
 
 *             new_msg.data = self.data
1813
 
 *         return new_msg
1814
 
 */
1815
 
  __pyx_t_2 = (__pyx_v_self->data != Py_None);
1816
 
  if (__pyx_t_2) {
1817
 
 
1818
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":340
1819
 
 *         # called.
1820
 
 *         if self.data is not None:
1821
 
 *             new_msg.data = self.data             # <<<<<<<<<<<<<<
1822
 
 *         return new_msg
1823
 
 * 
1824
 
 */
1825
 
    __Pyx_INCREF(__pyx_v_self->data);
1826
 
    __Pyx_GIVEREF(__pyx_v_self->data);
1827
 
    __Pyx_GOTREF(__pyx_v_new_msg->data);
1828
 
    __Pyx_DECREF(__pyx_v_new_msg->data);
1829
 
    __pyx_v_new_msg->data = __pyx_v_self->data;
1830
 
    goto __pyx_L3;
1831
 
  }
1832
 
  __pyx_L3:;
1833
 
 
1834
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":341
1835
 
 *         if self.data is not None:
1836
 
 *             new_msg.data = self.data
1837
 
 *         return new_msg             # <<<<<<<<<<<<<<
1838
 
 * 
1839
 
 *     def __len__(self):
1840
 
 */
1841
 
  __Pyx_XDECREF(((PyObject *)__pyx_r));
1842
 
  __Pyx_INCREF(((PyObject *)__pyx_v_new_msg));
1843
 
  __pyx_r = __pyx_v_new_msg;
1844
 
  goto __pyx_L0;
1845
 
 
1846
 
  __pyx_r = ((struct __pyx_obj_3zmq_4_zmq_Message *)Py_None); __Pyx_INCREF(Py_None);
1847
 
  goto __pyx_L0;
1848
 
  __pyx_L1_error:;
1849
 
  __Pyx_XDECREF(__pyx_t_1);
1850
 
  __Pyx_AddTraceback("zmq._zmq.Message.fast_copy");
1851
 
  __pyx_r = 0;
1852
 
  __pyx_L0:;
1853
 
  __Pyx_DECREF((PyObject *)__pyx_v_new_msg);
1854
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1855
 
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
1856
 
  __Pyx_RefNannyFinishContext();
1857
 
  return __pyx_r;
1858
 
}
1859
 
 
1860
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":343
1861
 
 *         return new_msg
1862
 
 * 
1863
 
 *     def __len__(self):             # <<<<<<<<<<<<<<
1864
 
 *         """Return the length of the message in bytes."""
1865
 
 *         return <int>zmq_msg_size(&self.zmq_msg)
1866
 
 */
1867
 
 
1868
 
static Py_ssize_t __pyx_pf_3zmq_4_zmq_7Message___len__(PyObject *__pyx_v_self); /*proto*/
1869
 
static char __pyx_doc_3zmq_4_zmq_7Message___len__[] = "Return the length of the message in bytes.";
1870
 
static Py_ssize_t __pyx_pf_3zmq_4_zmq_7Message___len__(PyObject *__pyx_v_self) {
1871
 
  Py_ssize_t __pyx_r;
1872
 
  __Pyx_RefNannySetupContext("__len__");
1873
 
 
1874
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":345
1875
 
 *     def __len__(self):
1876
 
 *         """Return the length of the message in bytes."""
1877
 
 *         return <int>zmq_msg_size(&self.zmq_msg)             # <<<<<<<<<<<<<<
1878
 
 * 
1879
 
 *     def __str__(self):
1880
 
 */
1881
 
  __pyx_r = ((int)zmq_msg_size((&((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->zmq_msg)));
1882
 
  goto __pyx_L0;
1883
 
 
1884
 
  __pyx_r = 0;
1885
 
  __pyx_L0:;
1886
 
  __Pyx_RefNannyFinishContext();
1887
 
  return __pyx_r;
1888
 
}
1889
 
 
1890
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":347
1891
 
 *         return <int>zmq_msg_size(&self.zmq_msg)
1892
 
 * 
1893
 
 *     def __str__(self):             # <<<<<<<<<<<<<<
1894
 
 *         """Return the str form of the message."""
1895
 
 *         cdef char *data_c = NULL
1896
 
 */
1897
 
 
1898
 
static PyObject *__pyx_pf_3zmq_4_zmq_7Message___str__(PyObject *__pyx_v_self); /*proto*/
1899
 
static char __pyx_doc_3zmq_4_zmq_7Message___str__[] = "Return the str form of the message.";
1900
 
static PyObject *__pyx_pf_3zmq_4_zmq_7Message___str__(PyObject *__pyx_v_self) {
1901
 
  char *__pyx_v_data_c;
1902
 
  Py_ssize_t __pyx_v_data_len_c;
1903
 
  PyObject *__pyx_r = NULL;
1904
 
  int __pyx_t_1;
1905
 
  PyObject *__pyx_t_2 = NULL;
1906
 
  __Pyx_RefNannySetupContext("__str__");
1907
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1908
 
 
1909
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":349
1910
 
 *     def __str__(self):
1911
 
 *         """Return the str form of the message."""
1912
 
 *         cdef char *data_c = NULL             # <<<<<<<<<<<<<<
1913
 
 *         cdef Py_ssize_t data_len_c
1914
 
 *         if self.data is None:
1915
 
 */
1916
 
  __pyx_v_data_c = NULL;
1917
 
 
1918
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":351
1919
 
 *         cdef char *data_c = NULL
1920
 
 *         cdef Py_ssize_t data_len_c
1921
 
 *         if self.data is None:             # <<<<<<<<<<<<<<
1922
 
 *             data_c = <char *>zmq_msg_data(&self.zmq_msg)
1923
 
 *             data_len_c = zmq_msg_size(&self.zmq_msg)
1924
 
 */
1925
 
  __pyx_t_1 = (((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->data == Py_None);
1926
 
  if (__pyx_t_1) {
1927
 
 
1928
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":352
1929
 
 *         cdef Py_ssize_t data_len_c
1930
 
 *         if self.data is None:
1931
 
 *             data_c = <char *>zmq_msg_data(&self.zmq_msg)             # <<<<<<<<<<<<<<
1932
 
 *             data_len_c = zmq_msg_size(&self.zmq_msg)
1933
 
 *             return PyString_FromStringAndSize(data_c, data_len_c)
1934
 
 */
1935
 
    __pyx_v_data_c = ((char *)zmq_msg_data((&((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->zmq_msg)));
1936
 
 
1937
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":353
1938
 
 *         if self.data is None:
1939
 
 *             data_c = <char *>zmq_msg_data(&self.zmq_msg)
1940
 
 *             data_len_c = zmq_msg_size(&self.zmq_msg)             # <<<<<<<<<<<<<<
1941
 
 *             return PyString_FromStringAndSize(data_c, data_len_c)
1942
 
 *         else:
1943
 
 */
1944
 
    __pyx_v_data_len_c = zmq_msg_size((&((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->zmq_msg));
1945
 
 
1946
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":354
1947
 
 *             data_c = <char *>zmq_msg_data(&self.zmq_msg)
1948
 
 *             data_len_c = zmq_msg_size(&self.zmq_msg)
1949
 
 *             return PyString_FromStringAndSize(data_c, data_len_c)             # <<<<<<<<<<<<<<
1950
 
 *         else:
1951
 
 *             return self.data
1952
 
 */
1953
 
    __Pyx_XDECREF(__pyx_r);
1954
 
    __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_data_c, __pyx_v_data_len_c); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1955
 
    __Pyx_GOTREF(__pyx_t_2);
1956
 
    __pyx_r = __pyx_t_2;
1957
 
    __pyx_t_2 = 0;
1958
 
    goto __pyx_L0;
1959
 
    goto __pyx_L5;
1960
 
  }
1961
 
  /*else*/ {
1962
 
 
1963
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":356
1964
 
 *             return PyString_FromStringAndSize(data_c, data_len_c)
1965
 
 *         else:
1966
 
 *             return self.data             # <<<<<<<<<<<<<<
1967
 
 * 
1968
 
 * 
1969
 
 */
1970
 
    __Pyx_XDECREF(__pyx_r);
1971
 
    __Pyx_INCREF(((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->data);
1972
 
    __pyx_r = ((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_v_self)->data;
1973
 
    goto __pyx_L0;
1974
 
  }
1975
 
  __pyx_L5:;
1976
 
 
1977
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1978
 
  goto __pyx_L0;
1979
 
  __pyx_L1_error:;
1980
 
  __Pyx_XDECREF(__pyx_t_2);
1981
 
  __Pyx_AddTraceback("zmq._zmq.Message.__str__");
1982
 
  __pyx_r = NULL;
1983
 
  __pyx_L0:;
1984
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1985
 
  __Pyx_XGIVEREF(__pyx_r);
1986
 
  __Pyx_RefNannyFinishContext();
1987
 
  return __pyx_r;
1988
 
}
1989
 
 
1990
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":373
1991
 
 *     cdef void *handle
1992
 
 * 
1993
 
 *     def __cinit__(self, int io_threads=1):             # <<<<<<<<<<<<<<
1994
 
 *         self.handle = NULL
1995
 
 *         if not io_threads > 0:
1996
 
 */
1997
 
 
1998
 
static int __pyx_pf_3zmq_4_zmq_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1999
 
static int __pyx_pf_3zmq_4_zmq_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2000
 
  int __pyx_v_io_threads;
2001
 
  int __pyx_r;
2002
 
  int __pyx_t_1;
2003
 
  PyObject *__pyx_t_2 = NULL;
2004
 
  PyObject *__pyx_t_3 = NULL;
2005
 
  PyObject *__pyx_t_4 = NULL;
2006
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__io_threads,0};
2007
 
  __Pyx_RefNannySetupContext("__cinit__");
2008
 
  if (unlikely(__pyx_kwds)) {
2009
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2010
 
    PyObject* values[1] = {0};
2011
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2012
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2013
 
      case  0: break;
2014
 
      default: goto __pyx_L5_argtuple_error;
2015
 
    }
2016
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2017
 
      case  0:
2018
 
      if (kw_args > 1) {
2019
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__io_threads);
2020
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
2021
 
      }
2022
 
    }
2023
 
    if (unlikely(kw_args > 0)) {
2024
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2025
 
    }
2026
 
    if (values[0]) {
2027
 
      __pyx_v_io_threads = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_io_threads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2028
 
    } else {
2029
 
      __pyx_v_io_threads = ((int)1);
2030
 
    }
2031
 
  } else {
2032
 
    __pyx_v_io_threads = ((int)1);
2033
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2034
 
      case  1: __pyx_v_io_threads = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_io_threads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2035
 
      case  0: break;
2036
 
      default: goto __pyx_L5_argtuple_error;
2037
 
    }
2038
 
  }
2039
 
  goto __pyx_L4_argument_unpacking_done;
2040
 
  __pyx_L5_argtuple_error:;
2041
 
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2042
 
  __pyx_L3_error:;
2043
 
  __Pyx_AddTraceback("zmq._zmq.Context.__cinit__");
2044
 
  return -1;
2045
 
  __pyx_L4_argument_unpacking_done:;
2046
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2047
 
 
2048
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":374
2049
 
 * 
2050
 
 *     def __cinit__(self, int io_threads=1):
2051
 
 *         self.handle = NULL             # <<<<<<<<<<<<<<
2052
 
 *         if not io_threads > 0:
2053
 
 *             raise ZMQError(EINVAL)
2054
 
 */
2055
 
  ((struct __pyx_obj_3zmq_4_zmq_Context *)__pyx_v_self)->handle = NULL;
2056
 
 
2057
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":375
2058
 
 *     def __cinit__(self, int io_threads=1):
2059
 
 *         self.handle = NULL
2060
 
 *         if not io_threads > 0:             # <<<<<<<<<<<<<<
2061
 
 *             raise ZMQError(EINVAL)
2062
 
 *         self.handle = zmq_init(io_threads)
2063
 
 */
2064
 
  __pyx_t_1 = (!(__pyx_v_io_threads > 0));
2065
 
  if (__pyx_t_1) {
2066
 
 
2067
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":376
2068
 
 *         self.handle = NULL
2069
 
 *         if not io_threads > 0:
2070
 
 *             raise ZMQError(EINVAL)             # <<<<<<<<<<<<<<
2071
 
 *         self.handle = zmq_init(io_threads)
2072
 
 *         if self.handle == NULL:
2073
 
 */
2074
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2075
 
    __Pyx_GOTREF(__pyx_t_2);
2076
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__EINVAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2077
 
    __Pyx_GOTREF(__pyx_t_3);
2078
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2079
 
    __Pyx_GOTREF(__pyx_t_4);
2080
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
2081
 
    __Pyx_GIVEREF(__pyx_t_3);
2082
 
    __pyx_t_3 = 0;
2083
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2084
 
    __Pyx_GOTREF(__pyx_t_3);
2085
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2086
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2087
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
2088
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2089
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2090
 
    goto __pyx_L6;
2091
 
  }
2092
 
  __pyx_L6:;
2093
 
 
2094
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":377
2095
 
 *         if not io_threads > 0:
2096
 
 *             raise ZMQError(EINVAL)
2097
 
 *         self.handle = zmq_init(io_threads)             # <<<<<<<<<<<<<<
2098
 
 *         if self.handle == NULL:
2099
 
 *             raise ZMQError()
2100
 
 */
2101
 
  ((struct __pyx_obj_3zmq_4_zmq_Context *)__pyx_v_self)->handle = zmq_init(__pyx_v_io_threads);
2102
 
 
2103
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":378
2104
 
 *             raise ZMQError(EINVAL)
2105
 
 *         self.handle = zmq_init(io_threads)
2106
 
 *         if self.handle == NULL:             # <<<<<<<<<<<<<<
2107
 
 *             raise ZMQError()
2108
 
 * 
2109
 
 */
2110
 
  __pyx_t_1 = (((struct __pyx_obj_3zmq_4_zmq_Context *)__pyx_v_self)->handle == NULL);
2111
 
  if (__pyx_t_1) {
2112
 
 
2113
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":379
2114
 
 *         self.handle = zmq_init(io_threads)
2115
 
 *         if self.handle == NULL:
2116
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
2117
 
 * 
2118
 
 *     def __dealloc__(self):
2119
 
 */
2120
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2121
 
    __Pyx_GOTREF(__pyx_t_3);
2122
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2123
 
    __Pyx_GOTREF(__pyx_t_4);
2124
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2125
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
2126
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2127
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2128
 
    goto __pyx_L7;
2129
 
  }
2130
 
  __pyx_L7:;
2131
 
 
2132
 
  __pyx_r = 0;
2133
 
  goto __pyx_L0;
2134
 
  __pyx_L1_error:;
2135
 
  __Pyx_XDECREF(__pyx_t_2);
2136
 
  __Pyx_XDECREF(__pyx_t_3);
2137
 
  __Pyx_XDECREF(__pyx_t_4);
2138
 
  __Pyx_AddTraceback("zmq._zmq.Context.__cinit__");
2139
 
  __pyx_r = -1;
2140
 
  __pyx_L0:;
2141
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2142
 
  __Pyx_RefNannyFinishContext();
2143
 
  return __pyx_r;
2144
 
}
2145
 
 
2146
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":381
2147
 
 *             raise ZMQError()
2148
 
 * 
2149
 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
2150
 
 *         cdef int rc
2151
 
 *         if self.handle != NULL:
2152
 
 */
2153
 
 
2154
 
static void __pyx_pf_3zmq_4_zmq_7Context___dealloc__(PyObject *__pyx_v_self); /*proto*/
2155
 
static void __pyx_pf_3zmq_4_zmq_7Context___dealloc__(PyObject *__pyx_v_self) {
2156
 
  int __pyx_v_rc;
2157
 
  int __pyx_t_1;
2158
 
  PyObject *__pyx_t_2 = NULL;
2159
 
  PyObject *__pyx_t_3 = NULL;
2160
 
  __Pyx_RefNannySetupContext("__dealloc__");
2161
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2162
 
 
2163
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":383
2164
 
 *     def __dealloc__(self):
2165
 
 *         cdef int rc
2166
 
 *         if self.handle != NULL:             # <<<<<<<<<<<<<<
2167
 
 *             rc = zmq_term(self.handle)
2168
 
 *             if rc != 0:
2169
 
 */
2170
 
  __pyx_t_1 = (((struct __pyx_obj_3zmq_4_zmq_Context *)__pyx_v_self)->handle != NULL);
2171
 
  if (__pyx_t_1) {
2172
 
 
2173
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":384
2174
 
 *         cdef int rc
2175
 
 *         if self.handle != NULL:
2176
 
 *             rc = zmq_term(self.handle)             # <<<<<<<<<<<<<<
2177
 
 *             if rc != 0:
2178
 
 *                 raise ZMQError()
2179
 
 */
2180
 
    __pyx_v_rc = zmq_term(((struct __pyx_obj_3zmq_4_zmq_Context *)__pyx_v_self)->handle);
2181
 
 
2182
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":385
2183
 
 *         if self.handle != NULL:
2184
 
 *             rc = zmq_term(self.handle)
2185
 
 *             if rc != 0:             # <<<<<<<<<<<<<<
2186
 
 *                 raise ZMQError()
2187
 
 * 
2188
 
 */
2189
 
    __pyx_t_1 = (__pyx_v_rc != 0);
2190
 
    if (__pyx_t_1) {
2191
 
 
2192
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":386
2193
 
 *             rc = zmq_term(self.handle)
2194
 
 *             if rc != 0:
2195
 
 *                 raise ZMQError()             # <<<<<<<<<<<<<<
2196
 
 * 
2197
 
 *     def socket(self, int socket_type):
2198
 
 */
2199
 
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2200
 
      __Pyx_GOTREF(__pyx_t_2);
2201
 
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2202
 
      __Pyx_GOTREF(__pyx_t_3);
2203
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2204
 
      __Pyx_Raise(__pyx_t_3, 0, 0);
2205
 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2206
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2207
 
      goto __pyx_L6;
2208
 
    }
2209
 
    __pyx_L6:;
2210
 
    goto __pyx_L5;
2211
 
  }
2212
 
  __pyx_L5:;
2213
 
 
2214
 
  goto __pyx_L0;
2215
 
  __pyx_L1_error:;
2216
 
  __Pyx_XDECREF(__pyx_t_2);
2217
 
  __Pyx_XDECREF(__pyx_t_3);
2218
 
  __Pyx_AddTraceback("zmq._zmq.Context.__dealloc__");
2219
 
  __pyx_L0:;
2220
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2221
 
  __Pyx_RefNannyFinishContext();
2222
 
}
2223
 
 
2224
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":388
2225
 
 *                 raise ZMQError()
2226
 
 * 
2227
 
 *     def socket(self, int socket_type):             # <<<<<<<<<<<<<<
2228
 
 *         """Create a Socket associated with this Context.
2229
 
 * 
2230
 
 */
2231
 
 
2232
 
static PyObject *__pyx_pf_3zmq_4_zmq_7Context_socket(PyObject *__pyx_v_self, PyObject *__pyx_arg_socket_type); /*proto*/
2233
 
static char __pyx_doc_3zmq_4_zmq_7Context_socket[] = "Create a Socket associated with this Context.\n\n        Parameters\n        ----------\n        socket_type : int\n            The socket type, which can be any of the 0MQ socket types: \n            REQ, REP, PUB, SUB, PAIR, XREQ, XREP, UPSTREAM, DOWNSTREAM.\n        ";
2234
 
static PyObject *__pyx_pf_3zmq_4_zmq_7Context_socket(PyObject *__pyx_v_self, PyObject *__pyx_arg_socket_type) {
2235
 
  int __pyx_v_socket_type;
2236
 
  PyObject *__pyx_r = NULL;
2237
 
  PyObject *__pyx_t_1 = NULL;
2238
 
  PyObject *__pyx_t_2 = NULL;
2239
 
  __Pyx_RefNannySetupContext("socket");
2240
 
  assert(__pyx_arg_socket_type); {
2241
 
    __pyx_v_socket_type = __Pyx_PyInt_AsInt(__pyx_arg_socket_type); if (unlikely((__pyx_v_socket_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2242
 
  }
2243
 
  goto __pyx_L4_argument_unpacking_done;
2244
 
  __pyx_L3_error:;
2245
 
  __Pyx_AddTraceback("zmq._zmq.Context.socket");
2246
 
  return NULL;
2247
 
  __pyx_L4_argument_unpacking_done:;
2248
 
 
2249
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":397
2250
 
 *             REQ, REP, PUB, SUB, PAIR, XREQ, XREP, UPSTREAM, DOWNSTREAM.
2251
 
 *         """
2252
 
 *         return Socket(self, socket_type)             # <<<<<<<<<<<<<<
2253
 
 * 
2254
 
 * 
2255
 
 */
2256
 
  __Pyx_XDECREF(__pyx_r);
2257
 
  __pyx_t_1 = PyInt_FromLong(__pyx_v_socket_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2258
 
  __Pyx_GOTREF(__pyx_t_1);
2259
 
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2260
 
  __Pyx_GOTREF(__pyx_t_2);
2261
 
  __Pyx_INCREF(__pyx_v_self);
2262
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
2263
 
  __Pyx_GIVEREF(__pyx_v_self);
2264
 
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
2265
 
  __Pyx_GIVEREF(__pyx_t_1);
2266
 
  __pyx_t_1 = 0;
2267
 
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3zmq_4_zmq_Socket)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2268
 
  __Pyx_GOTREF(__pyx_t_1);
2269
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2270
 
  __pyx_r = __pyx_t_1;
2271
 
  __pyx_t_1 = 0;
2272
 
  goto __pyx_L0;
2273
 
 
2274
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2275
 
  goto __pyx_L0;
2276
 
  __pyx_L1_error:;
2277
 
  __Pyx_XDECREF(__pyx_t_1);
2278
 
  __Pyx_XDECREF(__pyx_t_2);
2279
 
  __Pyx_AddTraceback("zmq._zmq.Context.socket");
2280
 
  __pyx_r = NULL;
2281
 
  __pyx_L0:;
2282
 
  __Pyx_XGIVEREF(__pyx_r);
2283
 
  __Pyx_RefNannyFinishContext();
2284
 
  return __pyx_r;
2285
 
}
2286
 
 
2287
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":418
2288
 
 *     # Hold on to a reference to the context to make sure it is not garbage
2289
 
 *     # collected until the socket it done with it.
2290
 
 *     cdef public Context context             # <<<<<<<<<<<<<<
2291
 
 *     cdef public object closed
2292
 
 * 
2293
 
 */
2294
 
 
2295
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_7context___get__(PyObject *__pyx_v_self); /*proto*/
2296
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_7context___get__(PyObject *__pyx_v_self) {
2297
 
  PyObject *__pyx_r = NULL;
2298
 
  __Pyx_RefNannySetupContext("__get__");
2299
 
  __Pyx_XDECREF(__pyx_r);
2300
 
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context));
2301
 
  __pyx_r = ((PyObject *)((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context);
2302
 
  goto __pyx_L0;
2303
 
 
2304
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2305
 
  __pyx_L0:;
2306
 
  __Pyx_XGIVEREF(__pyx_r);
2307
 
  __Pyx_RefNannyFinishContext();
2308
 
  return __pyx_r;
2309
 
}
2310
 
 
2311
 
static int __pyx_pf_3zmq_4_zmq_6Socket_7context___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
2312
 
static int __pyx_pf_3zmq_4_zmq_6Socket_7context___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
2313
 
  int __pyx_r;
2314
 
  __Pyx_RefNannySetupContext("__set__");
2315
 
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_3zmq_4_zmq_Context))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2316
 
  __Pyx_INCREF(__pyx_v_value);
2317
 
  __Pyx_GIVEREF(__pyx_v_value);
2318
 
  __Pyx_GOTREF(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context);
2319
 
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context));
2320
 
  ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context = ((struct __pyx_obj_3zmq_4_zmq_Context *)__pyx_v_value);
2321
 
 
2322
 
  __pyx_r = 0;
2323
 
  goto __pyx_L0;
2324
 
  __pyx_L1_error:;
2325
 
  __Pyx_AddTraceback("zmq._zmq.Socket.context.__set__");
2326
 
  __pyx_r = -1;
2327
 
  __pyx_L0:;
2328
 
  __Pyx_RefNannyFinishContext();
2329
 
  return __pyx_r;
2330
 
}
2331
 
 
2332
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":421
2333
 
 *     cdef public object closed
2334
 
 * 
2335
 
 *     def __cinit__(self, Context context, int socket_type):             # <<<<<<<<<<<<<<
2336
 
 *         self.handle = NULL
2337
 
 *         self.context = context
2338
 
 */
2339
 
 
2340
 
static int __pyx_pf_3zmq_4_zmq_6Socket___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2341
 
static int __pyx_pf_3zmq_4_zmq_6Socket___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2342
 
  struct __pyx_obj_3zmq_4_zmq_Context *__pyx_v_context = 0;
2343
 
  int __pyx_v_socket_type;
2344
 
  int __pyx_r;
2345
 
  int __pyx_t_1;
2346
 
  PyObject *__pyx_t_2 = NULL;
2347
 
  PyObject *__pyx_t_3 = NULL;
2348
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__context,&__pyx_n_s__socket_type,0};
2349
 
  __Pyx_RefNannySetupContext("__cinit__");
2350
 
  if (unlikely(__pyx_kwds)) {
2351
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2352
 
    PyObject* values[2] = {0,0};
2353
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2354
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2355
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2356
 
      case  0: break;
2357
 
      default: goto __pyx_L5_argtuple_error;
2358
 
    }
2359
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2360
 
      case  0:
2361
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__context);
2362
 
      if (likely(values[0])) kw_args--;
2363
 
      else goto __pyx_L5_argtuple_error;
2364
 
      case  1:
2365
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__socket_type);
2366
 
      if (likely(values[1])) kw_args--;
2367
 
      else {
2368
 
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2369
 
      }
2370
 
    }
2371
 
    if (unlikely(kw_args > 0)) {
2372
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2373
 
    }
2374
 
    __pyx_v_context = ((struct __pyx_obj_3zmq_4_zmq_Context *)values[0]);
2375
 
    __pyx_v_socket_type = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_socket_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2376
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2377
 
    goto __pyx_L5_argtuple_error;
2378
 
  } else {
2379
 
    __pyx_v_context = ((struct __pyx_obj_3zmq_4_zmq_Context *)PyTuple_GET_ITEM(__pyx_args, 0));
2380
 
    __pyx_v_socket_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_socket_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2381
 
  }
2382
 
  goto __pyx_L4_argument_unpacking_done;
2383
 
  __pyx_L5_argtuple_error:;
2384
 
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2385
 
  __pyx_L3_error:;
2386
 
  __Pyx_AddTraceback("zmq._zmq.Socket.__cinit__");
2387
 
  return -1;
2388
 
  __pyx_L4_argument_unpacking_done:;
2389
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2390
 
  __Pyx_INCREF((PyObject *)__pyx_v_context);
2391
 
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_3zmq_4_zmq_Context, 1, "context", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2392
 
 
2393
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":422
2394
 
 * 
2395
 
 *     def __cinit__(self, Context context, int socket_type):
2396
 
 *         self.handle = NULL             # <<<<<<<<<<<<<<
2397
 
 *         self.context = context
2398
 
 *         self.socket_type = socket_type
2399
 
 */
2400
 
  ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle = NULL;
2401
 
 
2402
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":423
2403
 
 *     def __cinit__(self, Context context, int socket_type):
2404
 
 *         self.handle = NULL
2405
 
 *         self.context = context             # <<<<<<<<<<<<<<
2406
 
 *         self.socket_type = socket_type
2407
 
 *         self.handle = zmq_socket(context.handle, socket_type)
2408
 
 */
2409
 
  __Pyx_INCREF(((PyObject *)__pyx_v_context));
2410
 
  __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
2411
 
  __Pyx_GOTREF(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context);
2412
 
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context));
2413
 
  ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->context = __pyx_v_context;
2414
 
 
2415
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":424
2416
 
 *         self.handle = NULL
2417
 
 *         self.context = context
2418
 
 *         self.socket_type = socket_type             # <<<<<<<<<<<<<<
2419
 
 *         self.handle = zmq_socket(context.handle, socket_type)
2420
 
 *         if self.handle == NULL:
2421
 
 */
2422
 
  ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->socket_type = __pyx_v_socket_type;
2423
 
 
2424
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":425
2425
 
 *         self.context = context
2426
 
 *         self.socket_type = socket_type
2427
 
 *         self.handle = zmq_socket(context.handle, socket_type)             # <<<<<<<<<<<<<<
2428
 
 *         if self.handle == NULL:
2429
 
 *             raise ZMQError()
2430
 
 */
2431
 
  ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle = zmq_socket(__pyx_v_context->handle, __pyx_v_socket_type);
2432
 
 
2433
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":426
2434
 
 *         self.socket_type = socket_type
2435
 
 *         self.handle = zmq_socket(context.handle, socket_type)
2436
 
 *         if self.handle == NULL:             # <<<<<<<<<<<<<<
2437
 
 *             raise ZMQError()
2438
 
 *         self.closed = False
2439
 
 */
2440
 
  __pyx_t_1 = (((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle == NULL);
2441
 
  if (__pyx_t_1) {
2442
 
 
2443
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":427
2444
 
 *         self.handle = zmq_socket(context.handle, socket_type)
2445
 
 *         if self.handle == NULL:
2446
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
2447
 
 *         self.closed = False
2448
 
 * 
2449
 
 */
2450
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2451
 
    __Pyx_GOTREF(__pyx_t_2);
2452
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2453
 
    __Pyx_GOTREF(__pyx_t_3);
2454
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2455
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
2456
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2457
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2458
 
    goto __pyx_L6;
2459
 
  }
2460
 
  __pyx_L6:;
2461
 
 
2462
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":428
2463
 
 *         if self.handle == NULL:
2464
 
 *             raise ZMQError()
2465
 
 *         self.closed = False             # <<<<<<<<<<<<<<
2466
 
 * 
2467
 
 *     def __dealloc__(self):
2468
 
 */
2469
 
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2470
 
  __Pyx_GOTREF(__pyx_t_3);
2471
 
  __Pyx_GIVEREF(__pyx_t_3);
2472
 
  __Pyx_GOTREF(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed);
2473
 
  __Pyx_DECREF(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed);
2474
 
  ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed = __pyx_t_3;
2475
 
  __pyx_t_3 = 0;
2476
 
 
2477
 
  __pyx_r = 0;
2478
 
  goto __pyx_L0;
2479
 
  __pyx_L1_error:;
2480
 
  __Pyx_XDECREF(__pyx_t_2);
2481
 
  __Pyx_XDECREF(__pyx_t_3);
2482
 
  __Pyx_AddTraceback("zmq._zmq.Socket.__cinit__");
2483
 
  __pyx_r = -1;
2484
 
  __pyx_L0:;
2485
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2486
 
  __Pyx_DECREF((PyObject *)__pyx_v_context);
2487
 
  __Pyx_RefNannyFinishContext();
2488
 
  return __pyx_r;
2489
 
}
2490
 
 
2491
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":430
2492
 
 *         self.closed = False
2493
 
 * 
2494
 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
2495
 
 *         self.close()
2496
 
 * 
2497
 
 */
2498
 
 
2499
 
static void __pyx_pf_3zmq_4_zmq_6Socket___dealloc__(PyObject *__pyx_v_self); /*proto*/
2500
 
static void __pyx_pf_3zmq_4_zmq_6Socket___dealloc__(PyObject *__pyx_v_self) {
2501
 
  PyObject *__pyx_t_1 = NULL;
2502
 
  PyObject *__pyx_t_2 = NULL;
2503
 
  __Pyx_RefNannySetupContext("__dealloc__");
2504
 
 
2505
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":431
2506
 
 * 
2507
 
 *     def __dealloc__(self):
2508
 
 *         self.close()             # <<<<<<<<<<<<<<
2509
 
 * 
2510
 
 *     def close(self):
2511
 
 */
2512
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2513
 
  __Pyx_GOTREF(__pyx_t_1);
2514
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2515
 
  __Pyx_GOTREF(__pyx_t_2);
2516
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2517
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2518
 
 
2519
 
  goto __pyx_L0;
2520
 
  __pyx_L1_error:;
2521
 
  __Pyx_XDECREF(__pyx_t_1);
2522
 
  __Pyx_XDECREF(__pyx_t_2);
2523
 
  __Pyx_AddTraceback("zmq._zmq.Socket.__dealloc__");
2524
 
  __pyx_L0:;
2525
 
  __Pyx_RefNannyFinishContext();
2526
 
}
2527
 
 
2528
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":433
2529
 
 *         self.close()
2530
 
 * 
2531
 
 *     def close(self):             # <<<<<<<<<<<<<<
2532
 
 *         """Close the socket.
2533
 
 * 
2534
 
 */
2535
 
 
2536
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
2537
 
static char __pyx_doc_3zmq_4_zmq_6Socket_close[] = "Close the socket.\n\n        This can be called to close the socket by hand. If this is not\n        called, the socket will automatically be closed when it is\n        garbage collected.\n        ";
2538
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_close(PyObject *__pyx_v_self, PyObject *unused) {
2539
 
  int __pyx_v_rc;
2540
 
  PyObject *__pyx_r = NULL;
2541
 
  int __pyx_t_1;
2542
 
  int __pyx_t_2;
2543
 
  int __pyx_t_3;
2544
 
  PyObject *__pyx_t_4 = NULL;
2545
 
  PyObject *__pyx_t_5 = NULL;
2546
 
  __Pyx_RefNannySetupContext("close");
2547
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2548
 
 
2549
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":441
2550
 
 *         """
2551
 
 *         cdef int rc
2552
 
 *         if self.handle != NULL and not self.closed:             # <<<<<<<<<<<<<<
2553
 
 *             rc = zmq_close(self.handle)
2554
 
 *             if rc != 0:
2555
 
 */
2556
 
  __pyx_t_1 = (((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle != NULL);
2557
 
  if (__pyx_t_1) {
2558
 
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2559
 
    __pyx_t_3 = (!__pyx_t_2);
2560
 
    __pyx_t_2 = __pyx_t_3;
2561
 
  } else {
2562
 
    __pyx_t_2 = __pyx_t_1;
2563
 
  }
2564
 
  if (__pyx_t_2) {
2565
 
 
2566
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":442
2567
 
 *         cdef int rc
2568
 
 *         if self.handle != NULL and not self.closed:
2569
 
 *             rc = zmq_close(self.handle)             # <<<<<<<<<<<<<<
2570
 
 *             if rc != 0:
2571
 
 *                 raise ZMQError()
2572
 
 */
2573
 
    __pyx_v_rc = zmq_close(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle);
2574
 
 
2575
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":443
2576
 
 *         if self.handle != NULL and not self.closed:
2577
 
 *             rc = zmq_close(self.handle)
2578
 
 *             if rc != 0:             # <<<<<<<<<<<<<<
2579
 
 *                 raise ZMQError()
2580
 
 *             self.handle = NULL
2581
 
 */
2582
 
    __pyx_t_2 = (__pyx_v_rc != 0);
2583
 
    if (__pyx_t_2) {
2584
 
 
2585
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":444
2586
 
 *             rc = zmq_close(self.handle)
2587
 
 *             if rc != 0:
2588
 
 *                 raise ZMQError()             # <<<<<<<<<<<<<<
2589
 
 *             self.handle = NULL
2590
 
 *             self.closed = True
2591
 
 */
2592
 
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2593
 
      __Pyx_GOTREF(__pyx_t_4);
2594
 
      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2595
 
      __Pyx_GOTREF(__pyx_t_5);
2596
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2597
 
      __Pyx_Raise(__pyx_t_5, 0, 0);
2598
 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2599
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2600
 
      goto __pyx_L6;
2601
 
    }
2602
 
    __pyx_L6:;
2603
 
 
2604
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":445
2605
 
 *             if rc != 0:
2606
 
 *                 raise ZMQError()
2607
 
 *             self.handle = NULL             # <<<<<<<<<<<<<<
2608
 
 *             self.closed = True
2609
 
 * 
2610
 
 */
2611
 
    ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle = NULL;
2612
 
 
2613
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":446
2614
 
 *                 raise ZMQError()
2615
 
 *             self.handle = NULL
2616
 
 *             self.closed = True             # <<<<<<<<<<<<<<
2617
 
 * 
2618
 
 *     def _check_closed(self):
2619
 
 */
2620
 
    __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2621
 
    __Pyx_GOTREF(__pyx_t_5);
2622
 
    __Pyx_GIVEREF(__pyx_t_5);
2623
 
    __Pyx_GOTREF(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed);
2624
 
    __Pyx_DECREF(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed);
2625
 
    ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed = __pyx_t_5;
2626
 
    __pyx_t_5 = 0;
2627
 
    goto __pyx_L5;
2628
 
  }
2629
 
  __pyx_L5:;
2630
 
 
2631
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2632
 
  goto __pyx_L0;
2633
 
  __pyx_L1_error:;
2634
 
  __Pyx_XDECREF(__pyx_t_4);
2635
 
  __Pyx_XDECREF(__pyx_t_5);
2636
 
  __Pyx_AddTraceback("zmq._zmq.Socket.close");
2637
 
  __pyx_r = NULL;
2638
 
  __pyx_L0:;
2639
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2640
 
  __Pyx_XGIVEREF(__pyx_r);
2641
 
  __Pyx_RefNannyFinishContext();
2642
 
  return __pyx_r;
2643
 
}
2644
 
 
2645
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":448
2646
 
 *             self.closed = True
2647
 
 * 
2648
 
 *     def _check_closed(self):             # <<<<<<<<<<<<<<
2649
 
 *         if self.closed:
2650
 
 *             raise ZMQError(ENOTSUP)
2651
 
 */
2652
 
 
2653
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__check_closed(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
2654
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__check_closed(PyObject *__pyx_v_self, PyObject *unused) {
2655
 
  PyObject *__pyx_r = NULL;
2656
 
  int __pyx_t_1;
2657
 
  PyObject *__pyx_t_2 = NULL;
2658
 
  PyObject *__pyx_t_3 = NULL;
2659
 
  PyObject *__pyx_t_4 = NULL;
2660
 
  __Pyx_RefNannySetupContext("_check_closed");
2661
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2662
 
 
2663
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":449
2664
 
 * 
2665
 
 *     def _check_closed(self):
2666
 
 *         if self.closed:             # <<<<<<<<<<<<<<
2667
 
 *             raise ZMQError(ENOTSUP)
2668
 
 * 
2669
 
 */
2670
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->closed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2671
 
  if (__pyx_t_1) {
2672
 
 
2673
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":450
2674
 
 *     def _check_closed(self):
2675
 
 *         if self.closed:
2676
 
 *             raise ZMQError(ENOTSUP)             # <<<<<<<<<<<<<<
2677
 
 * 
2678
 
 *     def setsockopt(self, int option, optval):
2679
 
 */
2680
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2681
 
    __Pyx_GOTREF(__pyx_t_2);
2682
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ENOTSUP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2683
 
    __Pyx_GOTREF(__pyx_t_3);
2684
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2685
 
    __Pyx_GOTREF(__pyx_t_4);
2686
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
2687
 
    __Pyx_GIVEREF(__pyx_t_3);
2688
 
    __pyx_t_3 = 0;
2689
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2690
 
    __Pyx_GOTREF(__pyx_t_3);
2691
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2692
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2693
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
2694
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2695
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2696
 
    goto __pyx_L5;
2697
 
  }
2698
 
  __pyx_L5:;
2699
 
 
2700
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2701
 
  goto __pyx_L0;
2702
 
  __pyx_L1_error:;
2703
 
  __Pyx_XDECREF(__pyx_t_2);
2704
 
  __Pyx_XDECREF(__pyx_t_3);
2705
 
  __Pyx_XDECREF(__pyx_t_4);
2706
 
  __Pyx_AddTraceback("zmq._zmq.Socket._check_closed");
2707
 
  __pyx_r = NULL;
2708
 
  __pyx_L0:;
2709
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2710
 
  __Pyx_XGIVEREF(__pyx_r);
2711
 
  __Pyx_RefNannyFinishContext();
2712
 
  return __pyx_r;
2713
 
}
2714
 
 
2715
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":452
2716
 
 *             raise ZMQError(ENOTSUP)
2717
 
 * 
2718
 
 *     def setsockopt(self, int option, optval):             # <<<<<<<<<<<<<<
2719
 
 *         """Set socket options.
2720
 
 * 
2721
 
 */
2722
 
 
2723
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_setsockopt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2724
 
static char __pyx_doc_3zmq_4_zmq_6Socket_setsockopt[] = "Set socket options.\n\n        See the 0MQ documentation for details on specific options.\n\n        Parameters\n        ----------\n        option : str\n            The name of the option to set. Can be any of: SUBSCRIBE, \n            UNSUBSCRIBE, IDENTITY, HWM, SWAP, AFFINITY, RATE, \n            RECOVERY_IVL, MCAST_LOOP, SNDBUF, RCVBUF.\n        optval : int or str\n            The value of the option to set.\n        ";
2725
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_setsockopt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2726
 
  int __pyx_v_option;
2727
 
  PyObject *__pyx_v_optval = 0;
2728
 
  pyzmq_int64_t __pyx_v_optval_int_c;
2729
 
  int __pyx_v_rc;
2730
 
  PyObject *__pyx_r = NULL;
2731
 
  PyObject *__pyx_t_1 = NULL;
2732
 
  PyObject *__pyx_t_2 = NULL;
2733
 
  int __pyx_t_3;
2734
 
  PyObject *__pyx_t_4 = NULL;
2735
 
  int __pyx_t_5;
2736
 
  int __pyx_t_6;
2737
 
  int __pyx_t_7;
2738
 
  char *__pyx_t_8;
2739
 
  Py_ssize_t __pyx_t_9;
2740
 
  pyzmq_int64_t __pyx_t_10;
2741
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__option,&__pyx_n_s__optval,0};
2742
 
  __Pyx_RefNannySetupContext("setsockopt");
2743
 
  if (unlikely(__pyx_kwds)) {
2744
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
2745
 
    PyObject* values[2] = {0,0};
2746
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2747
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2748
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2749
 
      case  0: break;
2750
 
      default: goto __pyx_L5_argtuple_error;
2751
 
    }
2752
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2753
 
      case  0:
2754
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__option);
2755
 
      if (likely(values[0])) kw_args--;
2756
 
      else goto __pyx_L5_argtuple_error;
2757
 
      case  1:
2758
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__optval);
2759
 
      if (likely(values[1])) kw_args--;
2760
 
      else {
2761
 
        __Pyx_RaiseArgtupleInvalid("setsockopt", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2762
 
      }
2763
 
    }
2764
 
    if (unlikely(kw_args > 0)) {
2765
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setsockopt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2766
 
    }
2767
 
    __pyx_v_option = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2768
 
    __pyx_v_optval = values[1];
2769
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2770
 
    goto __pyx_L5_argtuple_error;
2771
 
  } else {
2772
 
    __pyx_v_option = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2773
 
    __pyx_v_optval = PyTuple_GET_ITEM(__pyx_args, 1);
2774
 
  }
2775
 
  goto __pyx_L4_argument_unpacking_done;
2776
 
  __pyx_L5_argtuple_error:;
2777
 
  __Pyx_RaiseArgtupleInvalid("setsockopt", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2778
 
  __pyx_L3_error:;
2779
 
  __Pyx_AddTraceback("zmq._zmq.Socket.setsockopt");
2780
 
  return NULL;
2781
 
  __pyx_L4_argument_unpacking_done:;
2782
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2783
 
  __Pyx_INCREF(__pyx_v_optval);
2784
 
 
2785
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":469
2786
 
 *         cdef int rc
2787
 
 * 
2788
 
 *         self._check_closed()             # <<<<<<<<<<<<<<
2789
 
 * 
2790
 
 *         if option in [SUBSCRIBE, UNSUBSCRIBE, IDENTITY]:
2791
 
 */
2792
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2793
 
  __Pyx_GOTREF(__pyx_t_1);
2794
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2795
 
  __Pyx_GOTREF(__pyx_t_2);
2796
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2797
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2798
 
 
2799
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":471
2800
 
 *         self._check_closed()
2801
 
 * 
2802
 
 *         if option in [SUBSCRIBE, UNSUBSCRIBE, IDENTITY]:             # <<<<<<<<<<<<<<
2803
 
 *             if not isinstance(optval, str):
2804
 
 *                 raise TypeError('expected str, got: %r' % optval)
2805
 
 */
2806
 
  __pyx_t_3 = __pyx_v_option;
2807
 
  __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2808
 
  __Pyx_GOTREF(__pyx_t_2);
2809
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__SUBSCRIBE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2810
 
  __Pyx_GOTREF(__pyx_t_1);
2811
 
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2812
 
  __Pyx_GOTREF(__pyx_t_4);
2813
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2814
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2815
 
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2816
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2817
 
  __pyx_t_6 = ((int)__pyx_t_5);
2818
 
  if (!__pyx_t_6) {
2819
 
    __pyx_t_4 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2820
 
    __Pyx_GOTREF(__pyx_t_4);
2821
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__UNSUBSCRIBE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2822
 
    __Pyx_GOTREF(__pyx_t_1);
2823
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2824
 
    __Pyx_GOTREF(__pyx_t_2);
2825
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2826
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2827
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2828
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2829
 
    __pyx_t_7 = ((int)__pyx_t_5);
2830
 
    __pyx_t_5 = __pyx_t_7;
2831
 
  } else {
2832
 
    __pyx_t_5 = __pyx_t_6;
2833
 
  }
2834
 
  if (!__pyx_t_5) {
2835
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2836
 
    __Pyx_GOTREF(__pyx_t_2);
2837
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__IDENTITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2838
 
    __Pyx_GOTREF(__pyx_t_1);
2839
 
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2840
 
    __Pyx_GOTREF(__pyx_t_4);
2841
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2842
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2843
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2844
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2845
 
    __pyx_t_7 = ((int)__pyx_t_6);
2846
 
    __pyx_t_6 = __pyx_t_7;
2847
 
  } else {
2848
 
    __pyx_t_6 = __pyx_t_5;
2849
 
  }
2850
 
  __pyx_t_5 = __pyx_t_6;
2851
 
  if (__pyx_t_5) {
2852
 
 
2853
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":472
2854
 
 * 
2855
 
 *         if option in [SUBSCRIBE, UNSUBSCRIBE, IDENTITY]:
2856
 
 *             if not isinstance(optval, str):             # <<<<<<<<<<<<<<
2857
 
 *                 raise TypeError('expected str, got: %r' % optval)
2858
 
 *             rc = zmq_setsockopt(
2859
 
 */
2860
 
    __pyx_t_5 = PyObject_TypeCheck(__pyx_v_optval, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
2861
 
    __pyx_t_6 = (!__pyx_t_5);
2862
 
    if (__pyx_t_6) {
2863
 
 
2864
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":473
2865
 
 *         if option in [SUBSCRIBE, UNSUBSCRIBE, IDENTITY]:
2866
 
 *             if not isinstance(optval, str):
2867
 
 *                 raise TypeError('expected str, got: %r' % optval)             # <<<<<<<<<<<<<<
2868
 
 *             rc = zmq_setsockopt(
2869
 
 *                 self.handle, option,
2870
 
 */
2871
 
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_optval); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2872
 
      __Pyx_GOTREF(__pyx_t_4);
2873
 
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2874
 
      __Pyx_GOTREF(__pyx_t_1);
2875
 
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
2876
 
      __Pyx_GIVEREF(__pyx_t_4);
2877
 
      __pyx_t_4 = 0;
2878
 
      __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2879
 
      __Pyx_GOTREF(__pyx_t_4);
2880
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2881
 
      __Pyx_Raise(__pyx_t_4, 0, 0);
2882
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2883
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2884
 
      goto __pyx_L7;
2885
 
    }
2886
 
    __pyx_L7:;
2887
 
 
2888
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":476
2889
 
 *             rc = zmq_setsockopt(
2890
 
 *                 self.handle, option,
2891
 
 *                 PyString_AsString(optval), PyString_Size(optval)             # <<<<<<<<<<<<<<
2892
 
 *             )
2893
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
2894
 
 */
2895
 
    __pyx_t_8 = PyString_AsString(__pyx_v_optval); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2896
 
    __pyx_t_9 = PyString_Size(__pyx_v_optval); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2897
 
    __pyx_v_rc = zmq_setsockopt(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, __pyx_v_option, __pyx_t_8, __pyx_t_9);
2898
 
    goto __pyx_L6;
2899
 
  }
2900
 
 
2901
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":478
2902
 
 *                 PyString_AsString(optval), PyString_Size(optval)
2903
 
 *             )
2904
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
2905
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:
2906
 
 *             if not isinstance(optval, int):
2907
 
 */
2908
 
  __pyx_t_3 = __pyx_v_option;
2909
 
  __pyx_t_4 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2910
 
  __Pyx_GOTREF(__pyx_t_4);
2911
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__HWM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2912
 
  __Pyx_GOTREF(__pyx_t_1);
2913
 
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2914
 
  __Pyx_GOTREF(__pyx_t_2);
2915
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2916
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2917
 
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2918
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2919
 
  __pyx_t_5 = ((int)__pyx_t_6);
2920
 
  if (!__pyx_t_5) {
2921
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2922
 
    __Pyx_GOTREF(__pyx_t_2);
2923
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__SWAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2924
 
    __Pyx_GOTREF(__pyx_t_1);
2925
 
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2926
 
    __Pyx_GOTREF(__pyx_t_4);
2927
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2928
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2929
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2930
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2931
 
    __pyx_t_7 = ((int)__pyx_t_6);
2932
 
    __pyx_t_6 = __pyx_t_7;
2933
 
  } else {
2934
 
    __pyx_t_6 = __pyx_t_5;
2935
 
  }
2936
 
  if (!__pyx_t_6) {
2937
 
    __pyx_t_4 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2938
 
    __Pyx_GOTREF(__pyx_t_4);
2939
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__AFFINITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2940
 
    __Pyx_GOTREF(__pyx_t_1);
2941
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2942
 
    __Pyx_GOTREF(__pyx_t_2);
2943
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2944
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2945
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2946
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2947
 
    __pyx_t_7 = ((int)__pyx_t_5);
2948
 
    __pyx_t_5 = __pyx_t_7;
2949
 
  } else {
2950
 
    __pyx_t_5 = __pyx_t_6;
2951
 
  }
2952
 
  if (!__pyx_t_5) {
2953
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2954
 
    __Pyx_GOTREF(__pyx_t_2);
2955
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__RATE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2956
 
    __Pyx_GOTREF(__pyx_t_1);
2957
 
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2958
 
    __Pyx_GOTREF(__pyx_t_4);
2959
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2960
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2961
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2962
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2963
 
    __pyx_t_7 = ((int)__pyx_t_6);
2964
 
    __pyx_t_6 = __pyx_t_7;
2965
 
  } else {
2966
 
    __pyx_t_6 = __pyx_t_5;
2967
 
  }
2968
 
  if (!__pyx_t_6) {
2969
 
    __pyx_t_4 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2970
 
    __Pyx_GOTREF(__pyx_t_4);
2971
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__RECOVERY_IVL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2972
 
    __Pyx_GOTREF(__pyx_t_1);
2973
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2974
 
    __Pyx_GOTREF(__pyx_t_2);
2975
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2976
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2977
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2978
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2979
 
    __pyx_t_7 = ((int)__pyx_t_5);
2980
 
    __pyx_t_5 = __pyx_t_7;
2981
 
  } else {
2982
 
    __pyx_t_5 = __pyx_t_6;
2983
 
  }
2984
 
  if (!__pyx_t_5) {
2985
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2986
 
    __Pyx_GOTREF(__pyx_t_2);
2987
 
 
2988
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":479
2989
 
 *             )
2990
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
2991
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:             # <<<<<<<<<<<<<<
2992
 
 *             if not isinstance(optval, int):
2993
 
 *                 raise TypeError('expected int, got: %r' % optval)
2994
 
 */
2995
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__MCAST_LOOP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2996
 
    __Pyx_GOTREF(__pyx_t_1);
2997
 
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2998
 
    __Pyx_GOTREF(__pyx_t_4);
2999
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3000
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3001
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3002
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3003
 
    __pyx_t_7 = ((int)__pyx_t_6);
3004
 
    __pyx_t_6 = __pyx_t_7;
3005
 
  } else {
3006
 
    __pyx_t_6 = __pyx_t_5;
3007
 
  }
3008
 
  if (!__pyx_t_6) {
3009
 
 
3010
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":478
3011
 
 *                 PyString_AsString(optval), PyString_Size(optval)
3012
 
 *             )
3013
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
3014
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:
3015
 
 *             if not isinstance(optval, int):
3016
 
 */
3017
 
    __pyx_t_4 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3018
 
    __Pyx_GOTREF(__pyx_t_4);
3019
 
 
3020
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":479
3021
 
 *             )
3022
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3023
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:             # <<<<<<<<<<<<<<
3024
 
 *             if not isinstance(optval, int):
3025
 
 *                 raise TypeError('expected int, got: %r' % optval)
3026
 
 */
3027
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__SNDBUF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3028
 
    __Pyx_GOTREF(__pyx_t_1);
3029
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3030
 
    __Pyx_GOTREF(__pyx_t_2);
3031
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3032
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3033
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3034
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3035
 
    __pyx_t_7 = ((int)__pyx_t_5);
3036
 
    __pyx_t_5 = __pyx_t_7;
3037
 
  } else {
3038
 
    __pyx_t_5 = __pyx_t_6;
3039
 
  }
3040
 
  if (!__pyx_t_5) {
3041
 
 
3042
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":478
3043
 
 *                 PyString_AsString(optval), PyString_Size(optval)
3044
 
 *             )
3045
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
3046
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:
3047
 
 *             if not isinstance(optval, int):
3048
 
 */
3049
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3050
 
    __Pyx_GOTREF(__pyx_t_2);
3051
 
 
3052
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":479
3053
 
 *             )
3054
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3055
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:             # <<<<<<<<<<<<<<
3056
 
 *             if not isinstance(optval, int):
3057
 
 *                 raise TypeError('expected int, got: %r' % optval)
3058
 
 */
3059
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__RCVBUF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3060
 
    __Pyx_GOTREF(__pyx_t_1);
3061
 
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3062
 
    __Pyx_GOTREF(__pyx_t_4);
3063
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3064
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3065
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3066
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3067
 
    __pyx_t_7 = ((int)__pyx_t_6);
3068
 
    __pyx_t_6 = __pyx_t_7;
3069
 
  } else {
3070
 
    __pyx_t_6 = __pyx_t_5;
3071
 
  }
3072
 
  __pyx_t_5 = __pyx_t_6;
3073
 
  if (__pyx_t_5) {
3074
 
 
3075
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":480
3076
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3077
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:
3078
 
 *             if not isinstance(optval, int):             # <<<<<<<<<<<<<<
3079
 
 *                 raise TypeError('expected int, got: %r' % optval)
3080
 
 *             optval_int_c = optval
3081
 
 */
3082
 
    __pyx_t_5 = PyObject_TypeCheck(__pyx_v_optval, ((PyTypeObject *)((PyObject*)&PyInt_Type))); 
3083
 
    __pyx_t_6 = (!__pyx_t_5);
3084
 
    if (__pyx_t_6) {
3085
 
 
3086
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":481
3087
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF]:
3088
 
 *             if not isinstance(optval, int):
3089
 
 *                 raise TypeError('expected int, got: %r' % optval)             # <<<<<<<<<<<<<<
3090
 
 *             optval_int_c = optval
3091
 
 *             rc = zmq_setsockopt(
3092
 
 */
3093
 
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_v_optval); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3094
 
      __Pyx_GOTREF(__pyx_t_4);
3095
 
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3096
 
      __Pyx_GOTREF(__pyx_t_1);
3097
 
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
3098
 
      __Pyx_GIVEREF(__pyx_t_4);
3099
 
      __pyx_t_4 = 0;
3100
 
      __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3101
 
      __Pyx_GOTREF(__pyx_t_4);
3102
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3103
 
      __Pyx_Raise(__pyx_t_4, 0, 0);
3104
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3105
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3106
 
      goto __pyx_L8;
3107
 
    }
3108
 
    __pyx_L8:;
3109
 
 
3110
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":482
3111
 
 *             if not isinstance(optval, int):
3112
 
 *                 raise TypeError('expected int, got: %r' % optval)
3113
 
 *             optval_int_c = optval             # <<<<<<<<<<<<<<
3114
 
 *             rc = zmq_setsockopt(
3115
 
 *                 self.handle, option,
3116
 
 */
3117
 
    __pyx_t_10 = __Pyx_PyInt_from_py_pyzmq_int64_t(__pyx_v_optval); if (unlikely((__pyx_t_10 == (pyzmq_int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3118
 
    __pyx_v_optval_int_c = __pyx_t_10;
3119
 
 
3120
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":485
3121
 
 *             rc = zmq_setsockopt(
3122
 
 *                 self.handle, option,
3123
 
 *                 &optval_int_c, sizeof(int64_t)             # <<<<<<<<<<<<<<
3124
 
 *             )
3125
 
 *         else:
3126
 
 */
3127
 
    __pyx_v_rc = zmq_setsockopt(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, __pyx_v_option, (&__pyx_v_optval_int_c), (sizeof(pyzmq_int64_t)));
3128
 
    goto __pyx_L6;
3129
 
  }
3130
 
  /*else*/ {
3131
 
 
3132
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":488
3133
 
 *             )
3134
 
 *         else:
3135
 
 *             raise ZMQError(EINVAL)             # <<<<<<<<<<<<<<
3136
 
 * 
3137
 
 *         if rc != 0:
3138
 
 */
3139
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3140
 
    __Pyx_GOTREF(__pyx_t_4);
3141
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EINVAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3142
 
    __Pyx_GOTREF(__pyx_t_1);
3143
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3144
 
    __Pyx_GOTREF(__pyx_t_2);
3145
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3146
 
    __Pyx_GIVEREF(__pyx_t_1);
3147
 
    __pyx_t_1 = 0;
3148
 
    __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3149
 
    __Pyx_GOTREF(__pyx_t_1);
3150
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3151
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3152
 
    __Pyx_Raise(__pyx_t_1, 0, 0);
3153
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3154
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3155
 
  }
3156
 
  __pyx_L6:;
3157
 
 
3158
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":490
3159
 
 *             raise ZMQError(EINVAL)
3160
 
 * 
3161
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
3162
 
 *             raise ZMQError()
3163
 
 * 
3164
 
 */
3165
 
  __pyx_t_6 = (__pyx_v_rc != 0);
3166
 
  if (__pyx_t_6) {
3167
 
 
3168
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":491
3169
 
 * 
3170
 
 *         if rc != 0:
3171
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
3172
 
 * 
3173
 
 *     def getsockopt(self, int option):
3174
 
 */
3175
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3176
 
    __Pyx_GOTREF(__pyx_t_1);
3177
 
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3178
 
    __Pyx_GOTREF(__pyx_t_2);
3179
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3180
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
3181
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3182
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3183
 
    goto __pyx_L9;
3184
 
  }
3185
 
  __pyx_L9:;
3186
 
 
3187
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3188
 
  goto __pyx_L0;
3189
 
  __pyx_L1_error:;
3190
 
  __Pyx_XDECREF(__pyx_t_1);
3191
 
  __Pyx_XDECREF(__pyx_t_2);
3192
 
  __Pyx_XDECREF(__pyx_t_4);
3193
 
  __Pyx_AddTraceback("zmq._zmq.Socket.setsockopt");
3194
 
  __pyx_r = NULL;
3195
 
  __pyx_L0:;
3196
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3197
 
  __Pyx_DECREF(__pyx_v_optval);
3198
 
  __Pyx_XGIVEREF(__pyx_r);
3199
 
  __Pyx_RefNannyFinishContext();
3200
 
  return __pyx_r;
3201
 
}
3202
 
 
3203
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":493
3204
 
 *             raise ZMQError()
3205
 
 * 
3206
 
 *     def getsockopt(self, int option):             # <<<<<<<<<<<<<<
3207
 
 *         """Get the value of a socket option.
3208
 
 * 
3209
 
 */
3210
 
 
3211
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_getsockopt(PyObject *__pyx_v_self, PyObject *__pyx_arg_option); /*proto*/
3212
 
static char __pyx_doc_3zmq_4_zmq_6Socket_getsockopt[] = "Get the value of a socket option.\n\n        See the 0MQ documentation for details on specific options.\n\n        Parameters\n        ----------\n        option : str\n            The name of the option to set. Can be any of: \n            IDENTITY, HWM, SWAP, AFFINITY, RATE, \n            RECOVERY_IVL, MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE.\n\n        Returns\n        -------\n        The value of the option as a string or int.\n        ";
3213
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_getsockopt(PyObject *__pyx_v_self, PyObject *__pyx_arg_option) {
3214
 
  int __pyx_v_option;
3215
 
  pyzmq_int64_t __pyx_v_optval_int_c;
3216
 
  char __pyx_v_identity_str_c[255];
3217
 
  size_t __pyx_v_sz;
3218
 
  int __pyx_v_rc;
3219
 
  PyObject *__pyx_v_result;
3220
 
  PyObject *__pyx_r = NULL;
3221
 
  PyObject *__pyx_t_1 = NULL;
3222
 
  PyObject *__pyx_t_2 = NULL;
3223
 
  int __pyx_t_3;
3224
 
  PyObject *__pyx_t_4 = NULL;
3225
 
  int __pyx_t_5;
3226
 
  int __pyx_t_6;
3227
 
  int __pyx_t_7;
3228
 
  __Pyx_RefNannySetupContext("getsockopt");
3229
 
  assert(__pyx_arg_option); {
3230
 
    __pyx_v_option = __Pyx_PyInt_AsInt(__pyx_arg_option); if (unlikely((__pyx_v_option == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3231
 
  }
3232
 
  goto __pyx_L4_argument_unpacking_done;
3233
 
  __pyx_L3_error:;
3234
 
  __Pyx_AddTraceback("zmq._zmq.Socket.getsockopt");
3235
 
  return NULL;
3236
 
  __pyx_L4_argument_unpacking_done:;
3237
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3238
 
  __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
3239
 
 
3240
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":514
3241
 
 *         cdef int rc
3242
 
 * 
3243
 
 *         self._check_closed()             # <<<<<<<<<<<<<<
3244
 
 * 
3245
 
 *         if option in [IDENTITY]:
3246
 
 */
3247
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3248
 
  __Pyx_GOTREF(__pyx_t_1);
3249
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3250
 
  __Pyx_GOTREF(__pyx_t_2);
3251
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3252
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3253
 
 
3254
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":516
3255
 
 *         self._check_closed()
3256
 
 * 
3257
 
 *         if option in [IDENTITY]:             # <<<<<<<<<<<<<<
3258
 
 *             sz = 255
3259
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
3260
 
 */
3261
 
  __pyx_t_3 = __pyx_v_option;
3262
 
  __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3263
 
  __Pyx_GOTREF(__pyx_t_2);
3264
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__IDENTITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3265
 
  __Pyx_GOTREF(__pyx_t_1);
3266
 
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3267
 
  __Pyx_GOTREF(__pyx_t_4);
3268
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3269
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3270
 
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3271
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3272
 
  __pyx_t_6 = ((int)__pyx_t_5);
3273
 
  if (__pyx_t_6) {
3274
 
 
3275
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":517
3276
 
 * 
3277
 
 *         if option in [IDENTITY]:
3278
 
 *             sz = 255             # <<<<<<<<<<<<<<
3279
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
3280
 
 *             if rc != 0:
3281
 
 */
3282
 
    __pyx_v_sz = 255;
3283
 
 
3284
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":518
3285
 
 *         if option in [IDENTITY]:
3286
 
 *             sz = 255
3287
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)             # <<<<<<<<<<<<<<
3288
 
 *             if rc != 0:
3289
 
 *                 raise ZMQError()
3290
 
 */
3291
 
    __pyx_v_rc = zmq_getsockopt(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, __pyx_v_option, ((void *)__pyx_v_identity_str_c), (&__pyx_v_sz));
3292
 
 
3293
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":519
3294
 
 *             sz = 255
3295
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
3296
 
 *             if rc != 0:             # <<<<<<<<<<<<<<
3297
 
 *                 raise ZMQError()
3298
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3299
 
 */
3300
 
    __pyx_t_6 = (__pyx_v_rc != 0);
3301
 
    if (__pyx_t_6) {
3302
 
 
3303
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":520
3304
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>identity_str_c, &sz)
3305
 
 *             if rc != 0:
3306
 
 *                 raise ZMQError()             # <<<<<<<<<<<<<<
3307
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3308
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3309
 
 */
3310
 
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3311
 
      __Pyx_GOTREF(__pyx_t_4);
3312
 
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3313
 
      __Pyx_GOTREF(__pyx_t_1);
3314
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3315
 
      __Pyx_Raise(__pyx_t_1, 0, 0);
3316
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3317
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3318
 
      goto __pyx_L6;
3319
 
    }
3320
 
    __pyx_L6:;
3321
 
 
3322
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":521
3323
 
 *             if rc != 0:
3324
 
 *                 raise ZMQError()
3325
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)             # <<<<<<<<<<<<<<
3326
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3327
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3328
 
 */
3329
 
    __pyx_t_1 = PyString_FromStringAndSize(((char *)__pyx_v_identity_str_c), __pyx_v_sz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3330
 
    __Pyx_GOTREF(__pyx_t_1);
3331
 
    __Pyx_DECREF(__pyx_v_result);
3332
 
    __pyx_v_result = __pyx_t_1;
3333
 
    __pyx_t_1 = 0;
3334
 
    goto __pyx_L5;
3335
 
  }
3336
 
 
3337
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":522
3338
 
 *                 raise ZMQError()
3339
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3340
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
3341
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3342
 
 *             sz = sizeof(int64_t)
3343
 
 */
3344
 
  __pyx_t_3 = __pyx_v_option;
3345
 
  __pyx_t_1 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3346
 
  __Pyx_GOTREF(__pyx_t_1);
3347
 
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__HWM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3348
 
  __Pyx_GOTREF(__pyx_t_4);
3349
 
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3350
 
  __Pyx_GOTREF(__pyx_t_2);
3351
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3352
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3353
 
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3354
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3355
 
  __pyx_t_5 = ((int)__pyx_t_6);
3356
 
  if (!__pyx_t_5) {
3357
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3358
 
    __Pyx_GOTREF(__pyx_t_2);
3359
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__SWAP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3360
 
    __Pyx_GOTREF(__pyx_t_4);
3361
 
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3362
 
    __Pyx_GOTREF(__pyx_t_1);
3363
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3364
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3365
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3366
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3367
 
    __pyx_t_7 = ((int)__pyx_t_6);
3368
 
    __pyx_t_6 = __pyx_t_7;
3369
 
  } else {
3370
 
    __pyx_t_6 = __pyx_t_5;
3371
 
  }
3372
 
  if (!__pyx_t_6) {
3373
 
    __pyx_t_1 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3374
 
    __Pyx_GOTREF(__pyx_t_1);
3375
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__AFFINITY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3376
 
    __Pyx_GOTREF(__pyx_t_4);
3377
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3378
 
    __Pyx_GOTREF(__pyx_t_2);
3379
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3380
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3381
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3382
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3383
 
    __pyx_t_7 = ((int)__pyx_t_5);
3384
 
    __pyx_t_5 = __pyx_t_7;
3385
 
  } else {
3386
 
    __pyx_t_5 = __pyx_t_6;
3387
 
  }
3388
 
  if (!__pyx_t_5) {
3389
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3390
 
    __Pyx_GOTREF(__pyx_t_2);
3391
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__RATE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3392
 
    __Pyx_GOTREF(__pyx_t_4);
3393
 
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3394
 
    __Pyx_GOTREF(__pyx_t_1);
3395
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3396
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3397
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3398
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3399
 
    __pyx_t_7 = ((int)__pyx_t_6);
3400
 
    __pyx_t_6 = __pyx_t_7;
3401
 
  } else {
3402
 
    __pyx_t_6 = __pyx_t_5;
3403
 
  }
3404
 
  if (!__pyx_t_6) {
3405
 
    __pyx_t_1 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3406
 
    __Pyx_GOTREF(__pyx_t_1);
3407
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__RECOVERY_IVL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3408
 
    __Pyx_GOTREF(__pyx_t_4);
3409
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3410
 
    __Pyx_GOTREF(__pyx_t_2);
3411
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3412
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3413
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3414
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3415
 
    __pyx_t_7 = ((int)__pyx_t_5);
3416
 
    __pyx_t_5 = __pyx_t_7;
3417
 
  } else {
3418
 
    __pyx_t_5 = __pyx_t_6;
3419
 
  }
3420
 
  if (!__pyx_t_5) {
3421
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3422
 
    __Pyx_GOTREF(__pyx_t_2);
3423
 
 
3424
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":523
3425
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3426
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3427
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:             # <<<<<<<<<<<<<<
3428
 
 *             sz = sizeof(int64_t)
3429
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3430
 
 */
3431
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__MCAST_LOOP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3432
 
    __Pyx_GOTREF(__pyx_t_4);
3433
 
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3434
 
    __Pyx_GOTREF(__pyx_t_1);
3435
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3436
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3437
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3438
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3439
 
    __pyx_t_7 = ((int)__pyx_t_6);
3440
 
    __pyx_t_6 = __pyx_t_7;
3441
 
  } else {
3442
 
    __pyx_t_6 = __pyx_t_5;
3443
 
  }
3444
 
  if (!__pyx_t_6) {
3445
 
 
3446
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":522
3447
 
 *                 raise ZMQError()
3448
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3449
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
3450
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3451
 
 *             sz = sizeof(int64_t)
3452
 
 */
3453
 
    __pyx_t_1 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3454
 
    __Pyx_GOTREF(__pyx_t_1);
3455
 
 
3456
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":523
3457
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3458
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3459
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:             # <<<<<<<<<<<<<<
3460
 
 *             sz = sizeof(int64_t)
3461
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3462
 
 */
3463
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__SNDBUF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3464
 
    __Pyx_GOTREF(__pyx_t_4);
3465
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3466
 
    __Pyx_GOTREF(__pyx_t_2);
3467
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3468
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3469
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3470
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3471
 
    __pyx_t_7 = ((int)__pyx_t_5);
3472
 
    __pyx_t_5 = __pyx_t_7;
3473
 
  } else {
3474
 
    __pyx_t_5 = __pyx_t_6;
3475
 
  }
3476
 
  if (!__pyx_t_5) {
3477
 
 
3478
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":522
3479
 
 *                 raise ZMQError()
3480
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3481
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
3482
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3483
 
 *             sz = sizeof(int64_t)
3484
 
 */
3485
 
    __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3486
 
    __Pyx_GOTREF(__pyx_t_2);
3487
 
 
3488
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":523
3489
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3490
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3491
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:             # <<<<<<<<<<<<<<
3492
 
 *             sz = sizeof(int64_t)
3493
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3494
 
 */
3495
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__RCVBUF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3496
 
    __Pyx_GOTREF(__pyx_t_4);
3497
 
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3498
 
    __Pyx_GOTREF(__pyx_t_1);
3499
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3500
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3501
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3502
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3503
 
    __pyx_t_7 = ((int)__pyx_t_6);
3504
 
    __pyx_t_6 = __pyx_t_7;
3505
 
  } else {
3506
 
    __pyx_t_6 = __pyx_t_5;
3507
 
  }
3508
 
  if (!__pyx_t_6) {
3509
 
 
3510
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":522
3511
 
 *                 raise ZMQError()
3512
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3513
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,             # <<<<<<<<<<<<<<
3514
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3515
 
 *             sz = sizeof(int64_t)
3516
 
 */
3517
 
    __pyx_t_1 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3518
 
    __Pyx_GOTREF(__pyx_t_1);
3519
 
 
3520
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":523
3521
 
 *             result = PyString_FromStringAndSize(<char *>identity_str_c, sz)
3522
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3523
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:             # <<<<<<<<<<<<<<
3524
 
 *             sz = sizeof(int64_t)
3525
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3526
 
 */
3527
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__RCVMORE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3528
 
    __Pyx_GOTREF(__pyx_t_4);
3529
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3530
 
    __Pyx_GOTREF(__pyx_t_2);
3531
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3532
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3533
 
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3534
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3535
 
    __pyx_t_7 = ((int)__pyx_t_5);
3536
 
    __pyx_t_5 = __pyx_t_7;
3537
 
  } else {
3538
 
    __pyx_t_5 = __pyx_t_6;
3539
 
  }
3540
 
  __pyx_t_6 = __pyx_t_5;
3541
 
  if (__pyx_t_6) {
3542
 
 
3543
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":524
3544
 
 *         elif option in [HWM, SWAP, AFFINITY, RATE, RECOVERY_IVL,
3545
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3546
 
 *             sz = sizeof(int64_t)             # <<<<<<<<<<<<<<
3547
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3548
 
 *             if rc != 0:
3549
 
 */
3550
 
    __pyx_v_sz = (sizeof(pyzmq_int64_t));
3551
 
 
3552
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":525
3553
 
 *                         MCAST_LOOP, SNDBUF, RCVBUF, RCVMORE]:
3554
 
 *             sz = sizeof(int64_t)
3555
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)             # <<<<<<<<<<<<<<
3556
 
 *             if rc != 0:
3557
 
 *                 raise ZMQError()
3558
 
 */
3559
 
    __pyx_v_rc = zmq_getsockopt(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, __pyx_v_option, ((void *)(&__pyx_v_optval_int_c)), (&__pyx_v_sz));
3560
 
 
3561
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":526
3562
 
 *             sz = sizeof(int64_t)
3563
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3564
 
 *             if rc != 0:             # <<<<<<<<<<<<<<
3565
 
 *                 raise ZMQError()
3566
 
 *             result = optval_int_c
3567
 
 */
3568
 
    __pyx_t_6 = (__pyx_v_rc != 0);
3569
 
    if (__pyx_t_6) {
3570
 
 
3571
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":527
3572
 
 *             rc = zmq_getsockopt(self.handle, option, <void *>&optval_int_c, &sz)
3573
 
 *             if rc != 0:
3574
 
 *                 raise ZMQError()             # <<<<<<<<<<<<<<
3575
 
 *             result = optval_int_c
3576
 
 *         else:
3577
 
 */
3578
 
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3579
 
      __Pyx_GOTREF(__pyx_t_2);
3580
 
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3581
 
      __Pyx_GOTREF(__pyx_t_4);
3582
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3583
 
      __Pyx_Raise(__pyx_t_4, 0, 0);
3584
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3585
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3586
 
      goto __pyx_L7;
3587
 
    }
3588
 
    __pyx_L7:;
3589
 
 
3590
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":528
3591
 
 *             if rc != 0:
3592
 
 *                 raise ZMQError()
3593
 
 *             result = optval_int_c             # <<<<<<<<<<<<<<
3594
 
 *         else:
3595
 
 *             raise ZMQError()
3596
 
 */
3597
 
    __pyx_t_4 = __Pyx_PyInt_to_py_pyzmq_int64_t(__pyx_v_optval_int_c); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3598
 
    __Pyx_GOTREF(__pyx_t_4);
3599
 
    __Pyx_DECREF(__pyx_v_result);
3600
 
    __pyx_v_result = __pyx_t_4;
3601
 
    __pyx_t_4 = 0;
3602
 
    goto __pyx_L5;
3603
 
  }
3604
 
  /*else*/ {
3605
 
 
3606
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":530
3607
 
 *             result = optval_int_c
3608
 
 *         else:
3609
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
3610
 
 * 
3611
 
 *         return result
3612
 
 */
3613
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3614
 
    __Pyx_GOTREF(__pyx_t_4);
3615
 
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3616
 
    __Pyx_GOTREF(__pyx_t_2);
3617
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3618
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
3619
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3620
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3621
 
  }
3622
 
  __pyx_L5:;
3623
 
 
3624
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":532
3625
 
 *             raise ZMQError()
3626
 
 * 
3627
 
 *         return result             # <<<<<<<<<<<<<<
3628
 
 * 
3629
 
 *     def bind(self, addr):
3630
 
 */
3631
 
  __Pyx_XDECREF(__pyx_r);
3632
 
  __Pyx_INCREF(__pyx_v_result);
3633
 
  __pyx_r = __pyx_v_result;
3634
 
  goto __pyx_L0;
3635
 
 
3636
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3637
 
  goto __pyx_L0;
3638
 
  __pyx_L1_error:;
3639
 
  __Pyx_XDECREF(__pyx_t_1);
3640
 
  __Pyx_XDECREF(__pyx_t_2);
3641
 
  __Pyx_XDECREF(__pyx_t_4);
3642
 
  __Pyx_AddTraceback("zmq._zmq.Socket.getsockopt");
3643
 
  __pyx_r = NULL;
3644
 
  __pyx_L0:;
3645
 
  __Pyx_DECREF(__pyx_v_result);
3646
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3647
 
  __Pyx_XGIVEREF(__pyx_r);
3648
 
  __Pyx_RefNannyFinishContext();
3649
 
  return __pyx_r;
3650
 
}
3651
 
 
3652
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":534
3653
 
 *         return result
3654
 
 * 
3655
 
 *     def bind(self, addr):             # <<<<<<<<<<<<<<
3656
 
 *         """Bind the socket to an address.
3657
 
 * 
3658
 
 */
3659
 
 
3660
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_bind(PyObject *__pyx_v_self, PyObject *__pyx_v_addr); /*proto*/
3661
 
static char __pyx_doc_3zmq_4_zmq_6Socket_bind[] = "Bind the socket to an address.\n\n        This causes the socket to listen on a network port. Sockets on the\n        other side of this connection will use :meth:`Sockiet.connect` to\n        connect to this socket.\n\n        Parameters\n        ----------\n        addr : str\n            The address string. This has the form 'protocol://interface:port',\n            for example 'tcp://127.0.0.1:5555'. Protocols supported are\n            tcp, upd, pgm, inproc and ipc.\n        ";
3662
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_bind(PyObject *__pyx_v_self, PyObject *__pyx_v_addr) {
3663
 
  int __pyx_v_rc;
3664
 
  PyObject *__pyx_r = NULL;
3665
 
  PyObject *__pyx_t_1 = NULL;
3666
 
  PyObject *__pyx_t_2 = NULL;
3667
 
  int __pyx_t_3;
3668
 
  int __pyx_t_4;
3669
 
  char *__pyx_t_5;
3670
 
  __Pyx_RefNannySetupContext("bind");
3671
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3672
 
  __Pyx_INCREF(__pyx_v_addr);
3673
 
 
3674
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":550
3675
 
 *         cdef int rc
3676
 
 * 
3677
 
 *         self._check_closed()             # <<<<<<<<<<<<<<
3678
 
 * 
3679
 
 *         if not isinstance(addr, str):
3680
 
 */
3681
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3682
 
  __Pyx_GOTREF(__pyx_t_1);
3683
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3684
 
  __Pyx_GOTREF(__pyx_t_2);
3685
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3686
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3687
 
 
3688
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":552
3689
 
 *         self._check_closed()
3690
 
 * 
3691
 
 *         if not isinstance(addr, str):             # <<<<<<<<<<<<<<
3692
 
 *             raise TypeError('expected str, got: %r' % addr)
3693
 
 *         rc = zmq_bind(self.handle, addr)
3694
 
 */
3695
 
  __pyx_t_3 = PyObject_TypeCheck(__pyx_v_addr, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
3696
 
  __pyx_t_4 = (!__pyx_t_3);
3697
 
  if (__pyx_t_4) {
3698
 
 
3699
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":553
3700
 
 * 
3701
 
 *         if not isinstance(addr, str):
3702
 
 *             raise TypeError('expected str, got: %r' % addr)             # <<<<<<<<<<<<<<
3703
 
 *         rc = zmq_bind(self.handle, addr)
3704
 
 *         if rc != 0:
3705
 
 */
3706
 
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_addr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3707
 
    __Pyx_GOTREF(__pyx_t_2);
3708
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3709
 
    __Pyx_GOTREF(__pyx_t_1);
3710
 
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3711
 
    __Pyx_GIVEREF(__pyx_t_2);
3712
 
    __pyx_t_2 = 0;
3713
 
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3714
 
    __Pyx_GOTREF(__pyx_t_2);
3715
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3716
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
3717
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3718
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3719
 
    goto __pyx_L5;
3720
 
  }
3721
 
  __pyx_L5:;
3722
 
 
3723
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":554
3724
 
 *         if not isinstance(addr, str):
3725
 
 *             raise TypeError('expected str, got: %r' % addr)
3726
 
 *         rc = zmq_bind(self.handle, addr)             # <<<<<<<<<<<<<<
3727
 
 *         if rc != 0:
3728
 
 *             raise ZMQError()
3729
 
 */
3730
 
  __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3731
 
  __pyx_v_rc = zmq_bind(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, __pyx_t_5);
3732
 
 
3733
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":555
3734
 
 *             raise TypeError('expected str, got: %r' % addr)
3735
 
 *         rc = zmq_bind(self.handle, addr)
3736
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
3737
 
 *             raise ZMQError()
3738
 
 * 
3739
 
 */
3740
 
  __pyx_t_4 = (__pyx_v_rc != 0);
3741
 
  if (__pyx_t_4) {
3742
 
 
3743
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":556
3744
 
 *         rc = zmq_bind(self.handle, addr)
3745
 
 *         if rc != 0:
3746
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
3747
 
 * 
3748
 
 *     def bind_to_random_port(self, addr, min_port=2000, max_port=20000, max_tries=100):
3749
 
 */
3750
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3751
 
    __Pyx_GOTREF(__pyx_t_2);
3752
 
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3753
 
    __Pyx_GOTREF(__pyx_t_1);
3754
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3755
 
    __Pyx_Raise(__pyx_t_1, 0, 0);
3756
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3757
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3758
 
    goto __pyx_L6;
3759
 
  }
3760
 
  __pyx_L6:;
3761
 
 
3762
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3763
 
  goto __pyx_L0;
3764
 
  __pyx_L1_error:;
3765
 
  __Pyx_XDECREF(__pyx_t_1);
3766
 
  __Pyx_XDECREF(__pyx_t_2);
3767
 
  __Pyx_AddTraceback("zmq._zmq.Socket.bind");
3768
 
  __pyx_r = NULL;
3769
 
  __pyx_L0:;
3770
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3771
 
  __Pyx_DECREF(__pyx_v_addr);
3772
 
  __Pyx_XGIVEREF(__pyx_r);
3773
 
  __Pyx_RefNannyFinishContext();
3774
 
  return __pyx_r;
3775
 
}
3776
 
 
3777
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":558
3778
 
 *             raise ZMQError()
3779
 
 * 
3780
 
 *     def bind_to_random_port(self, addr, min_port=2000, max_port=20000, max_tries=100):             # <<<<<<<<<<<<<<
3781
 
 *         """Bind this socket to a random port in a range.
3782
 
 * 
3783
 
 */
3784
 
 
3785
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_bind_to_random_port(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3786
 
static char __pyx_doc_3zmq_4_zmq_6Socket_bind_to_random_port[] = "Bind this socket to a random port in a range.\n\n        Parameters\n        ----------\n        addr : str\n            The address string without the port to pass to :meth:`Socket.bind`.\n        min_port : int\n            The minimum port in the range of ports to try.\n        max_port : int\n            The maximum port in the range of ports to try.\n        max_tries : int\n            The number of attempt to bind.\n\n        Returns\n        -------\n        port : int\n            The port the socket was bound to.\n        ";
3787
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_bind_to_random_port(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3788
 
  PyObject *__pyx_v_addr = 0;
3789
 
  PyObject *__pyx_v_min_port = 0;
3790
 
  PyObject *__pyx_v_max_port = 0;
3791
 
  PyObject *__pyx_v_max_tries = 0;
3792
 
  PyObject *__pyx_v_i;
3793
 
  PyObject *__pyx_v_port;
3794
 
  PyObject *__pyx_r = NULL;
3795
 
  Py_ssize_t __pyx_t_1;
3796
 
  PyObject *__pyx_t_2 = NULL;
3797
 
  PyObject *__pyx_t_3 = NULL;
3798
 
  PyObject *__pyx_t_4 = NULL;
3799
 
  PyObject *__pyx_t_5 = NULL;
3800
 
  int __pyx_t_6;
3801
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__addr,&__pyx_n_s__min_port,&__pyx_n_s__max_port,&__pyx_n_s__max_tries,0};
3802
 
  __Pyx_RefNannySetupContext("bind_to_random_port");
3803
 
  if (unlikely(__pyx_kwds)) {
3804
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
3805
 
    PyObject* values[4] = {0,0,0,0};
3806
 
    values[1] = ((PyObject *)__pyx_int_2000);
3807
 
    values[2] = ((PyObject *)__pyx_int_20000);
3808
 
    values[3] = ((PyObject *)__pyx_int_100);
3809
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
3810
 
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3811
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3812
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3813
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3814
 
      case  0: break;
3815
 
      default: goto __pyx_L5_argtuple_error;
3816
 
    }
3817
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
3818
 
      case  0:
3819
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__addr);
3820
 
      if (likely(values[0])) kw_args--;
3821
 
      else goto __pyx_L5_argtuple_error;
3822
 
      case  1:
3823
 
      if (kw_args > 1) {
3824
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_port);
3825
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
3826
 
      }
3827
 
      case  2:
3828
 
      if (kw_args > 1) {
3829
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_port);
3830
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
3831
 
      }
3832
 
      case  3:
3833
 
      if (kw_args > 1) {
3834
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_tries);
3835
 
        if (unlikely(value)) { values[3] = value; kw_args--; }
3836
 
      }
3837
 
    }
3838
 
    if (unlikely(kw_args > 0)) {
3839
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "bind_to_random_port") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3840
 
    }
3841
 
    __pyx_v_addr = values[0];
3842
 
    __pyx_v_min_port = values[1];
3843
 
    __pyx_v_max_port = values[2];
3844
 
    __pyx_v_max_tries = values[3];
3845
 
  } else {
3846
 
    __pyx_v_min_port = ((PyObject *)__pyx_int_2000);
3847
 
    __pyx_v_max_port = ((PyObject *)__pyx_int_20000);
3848
 
    __pyx_v_max_tries = ((PyObject *)__pyx_int_100);
3849
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
3850
 
      case  4: __pyx_v_max_tries = PyTuple_GET_ITEM(__pyx_args, 3);
3851
 
      case  3: __pyx_v_max_port = PyTuple_GET_ITEM(__pyx_args, 2);
3852
 
      case  2: __pyx_v_min_port = PyTuple_GET_ITEM(__pyx_args, 1);
3853
 
      case  1: __pyx_v_addr = PyTuple_GET_ITEM(__pyx_args, 0);
3854
 
      break;
3855
 
      default: goto __pyx_L5_argtuple_error;
3856
 
    }
3857
 
  }
3858
 
  goto __pyx_L4_argument_unpacking_done;
3859
 
  __pyx_L5_argtuple_error:;
3860
 
  __Pyx_RaiseArgtupleInvalid("bind_to_random_port", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3861
 
  __pyx_L3_error:;
3862
 
  __Pyx_AddTraceback("zmq._zmq.Socket.bind_to_random_port");
3863
 
  return NULL;
3864
 
  __pyx_L4_argument_unpacking_done:;
3865
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3866
 
  __Pyx_INCREF(__pyx_v_addr);
3867
 
  __Pyx_INCREF(__pyx_v_min_port);
3868
 
  __Pyx_INCREF(__pyx_v_max_port);
3869
 
  __Pyx_INCREF(__pyx_v_max_tries);
3870
 
  __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
3871
 
  __pyx_v_port = Py_None; __Pyx_INCREF(Py_None);
3872
 
 
3873
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":577
3874
 
 *             The port the socket was bound to.
3875
 
 *         """
3876
 
 *         for i in range(max_tries):             # <<<<<<<<<<<<<<
3877
 
 *             try:
3878
 
 *                 port = random.randrange(min_port, max_port)
3879
 
 */
3880
 
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3881
 
  __Pyx_GOTREF(__pyx_t_2);
3882
 
  __Pyx_INCREF(__pyx_v_max_tries);
3883
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_max_tries);
3884
 
  __Pyx_GIVEREF(__pyx_v_max_tries);
3885
 
  __pyx_t_3 = PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3886
 
  __Pyx_GOTREF(__pyx_t_3);
3887
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3888
 
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
3889
 
    __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
3890
 
  } else {
3891
 
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3892
 
    __Pyx_GOTREF(__pyx_t_2);
3893
 
  }
3894
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895
 
  for (;;) {
3896
 
    if (likely(PyList_CheckExact(__pyx_t_2))) {
3897
 
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
3898
 
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
3899
 
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
3900
 
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
3901
 
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
3902
 
    } else {
3903
 
      __pyx_t_3 = PyIter_Next(__pyx_t_2);
3904
 
      if (!__pyx_t_3) {
3905
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3906
 
        break;
3907
 
      }
3908
 
      __Pyx_GOTREF(__pyx_t_3);
3909
 
    }
3910
 
    __Pyx_DECREF(__pyx_v_i);
3911
 
    __pyx_v_i = __pyx_t_3;
3912
 
    __pyx_t_3 = 0;
3913
 
 
3914
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":578
3915
 
 *         """
3916
 
 *         for i in range(max_tries):
3917
 
 *             try:             # <<<<<<<<<<<<<<
3918
 
 *                 port = random.randrange(min_port, max_port)
3919
 
 *                 self.bind('%s:%s' % (addr, port))
3920
 
 */
3921
 
    {
3922
 
      PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
3923
 
      __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
3924
 
      __Pyx_XGOTREF(__pyx_save_exc_type);
3925
 
      __Pyx_XGOTREF(__pyx_save_exc_value);
3926
 
      __Pyx_XGOTREF(__pyx_save_exc_tb);
3927
 
      /*try:*/ {
3928
 
 
3929
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":579
3930
 
 *         for i in range(max_tries):
3931
 
 *             try:
3932
 
 *                 port = random.randrange(min_port, max_port)             # <<<<<<<<<<<<<<
3933
 
 *                 self.bind('%s:%s' % (addr, port))
3934
 
 *             except ZMQError:
3935
 
 */
3936
 
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3937
 
        __Pyx_GOTREF(__pyx_t_3);
3938
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__randrange); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3939
 
        __Pyx_GOTREF(__pyx_t_4);
3940
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3941
 
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3942
 
        __Pyx_GOTREF(__pyx_t_3);
3943
 
        __Pyx_INCREF(__pyx_v_min_port);
3944
 
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_min_port);
3945
 
        __Pyx_GIVEREF(__pyx_v_min_port);
3946
 
        __Pyx_INCREF(__pyx_v_max_port);
3947
 
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_max_port);
3948
 
        __Pyx_GIVEREF(__pyx_v_max_port);
3949
 
        __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3950
 
        __Pyx_GOTREF(__pyx_t_5);
3951
 
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3952
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3953
 
        __Pyx_DECREF(__pyx_v_port);
3954
 
        __pyx_v_port = __pyx_t_5;
3955
 
        __pyx_t_5 = 0;
3956
 
 
3957
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":580
3958
 
 *             try:
3959
 
 *                 port = random.randrange(min_port, max_port)
3960
 
 *                 self.bind('%s:%s' % (addr, port))             # <<<<<<<<<<<<<<
3961
 
 *             except ZMQError:
3962
 
 *                 pass
3963
 
 */
3964
 
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__bind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3965
 
        __Pyx_GOTREF(__pyx_t_5);
3966
 
        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3967
 
        __Pyx_GOTREF(__pyx_t_3);
3968
 
        __Pyx_INCREF(__pyx_v_addr);
3969
 
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_addr);
3970
 
        __Pyx_GIVEREF(__pyx_v_addr);
3971
 
        __Pyx_INCREF(__pyx_v_port);
3972
 
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_port);
3973
 
        __Pyx_GIVEREF(__pyx_v_port);
3974
 
        __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3975
 
        __Pyx_GOTREF(__pyx_t_4);
3976
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3977
 
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3978
 
        __Pyx_GOTREF(__pyx_t_3);
3979
 
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
3980
 
        __Pyx_GIVEREF(__pyx_t_4);
3981
 
        __pyx_t_4 = 0;
3982
 
        __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
3983
 
        __Pyx_GOTREF(__pyx_t_4);
3984
 
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3985
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3986
 
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3987
 
      }
3988
 
      /*else:*/ {
3989
 
 
3990
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":584
3991
 
 *                 pass
3992
 
 *             else:
3993
 
 *                 return port             # <<<<<<<<<<<<<<
3994
 
 *         raise ZMQBindError("Could not bind socket to random port.")
3995
 
 * 
3996
 
 */
3997
 
        __Pyx_XDECREF(__pyx_r);
3998
 
        __Pyx_INCREF(__pyx_v_port);
3999
 
        __pyx_r = __pyx_v_port;
4000
 
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4001
 
        goto __pyx_L11_except_return;
4002
 
      }
4003
 
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
4004
 
      __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
4005
 
      __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
4006
 
      goto __pyx_L15_try_end;
4007
 
      __pyx_L8_error:;
4008
 
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4009
 
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4010
 
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4011
 
 
4012
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":581
4013
 
 *                 port = random.randrange(min_port, max_port)
4014
 
 *                 self.bind('%s:%s' % (addr, port))
4015
 
 *             except ZMQError:             # <<<<<<<<<<<<<<
4016
 
 *                 pass
4017
 
 *             else:
4018
 
 */
4019
 
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
4020
 
      __Pyx_GOTREF(__pyx_t_4);
4021
 
      __pyx_t_6 = PyErr_ExceptionMatches(__pyx_t_4);
4022
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4023
 
      if (__pyx_t_6) {
4024
 
        PyErr_Restore(0,0,0);
4025
 
        goto __pyx_L9_exception_handled;
4026
 
      }
4027
 
      __pyx_L10_except_error:;
4028
 
      __Pyx_XGIVEREF(__pyx_save_exc_type);
4029
 
      __Pyx_XGIVEREF(__pyx_save_exc_value);
4030
 
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
4031
 
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
4032
 
      goto __pyx_L1_error;
4033
 
      __pyx_L11_except_return:;
4034
 
      __Pyx_XGIVEREF(__pyx_save_exc_type);
4035
 
      __Pyx_XGIVEREF(__pyx_save_exc_value);
4036
 
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
4037
 
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
4038
 
      goto __pyx_L0;
4039
 
      __pyx_L9_exception_handled:;
4040
 
      __Pyx_XGIVEREF(__pyx_save_exc_type);
4041
 
      __Pyx_XGIVEREF(__pyx_save_exc_value);
4042
 
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
4043
 
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
4044
 
      __pyx_L15_try_end:;
4045
 
    }
4046
 
  }
4047
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4048
 
 
4049
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":585
4050
 
 *             else:
4051
 
 *                 return port
4052
 
 *         raise ZMQBindError("Could not bind socket to random port.")             # <<<<<<<<<<<<<<
4053
 
 * 
4054
 
 *     def connect(self, addr):
4055
 
 */
4056
 
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQBindError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4057
 
  __Pyx_GOTREF(__pyx_t_2);
4058
 
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4059
 
  __Pyx_GOTREF(__pyx_t_4);
4060
 
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
4061
 
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_4));
4062
 
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
4063
 
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4064
 
  __Pyx_GOTREF(__pyx_t_3);
4065
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4066
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4067
 
  __Pyx_Raise(__pyx_t_3, 0, 0);
4068
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4069
 
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4070
 
 
4071
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4072
 
  goto __pyx_L0;
4073
 
  __pyx_L1_error:;
4074
 
  __Pyx_XDECREF(__pyx_t_2);
4075
 
  __Pyx_XDECREF(__pyx_t_3);
4076
 
  __Pyx_XDECREF(__pyx_t_4);
4077
 
  __Pyx_XDECREF(__pyx_t_5);
4078
 
  __Pyx_AddTraceback("zmq._zmq.Socket.bind_to_random_port");
4079
 
  __pyx_r = NULL;
4080
 
  __pyx_L0:;
4081
 
  __Pyx_DECREF(__pyx_v_i);
4082
 
  __Pyx_DECREF(__pyx_v_port);
4083
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
4084
 
  __Pyx_DECREF(__pyx_v_addr);
4085
 
  __Pyx_DECREF(__pyx_v_min_port);
4086
 
  __Pyx_DECREF(__pyx_v_max_port);
4087
 
  __Pyx_DECREF(__pyx_v_max_tries);
4088
 
  __Pyx_XGIVEREF(__pyx_r);
4089
 
  __Pyx_RefNannyFinishContext();
4090
 
  return __pyx_r;
4091
 
}
4092
 
 
4093
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":587
4094
 
 *         raise ZMQBindError("Could not bind socket to random port.")
4095
 
 * 
4096
 
 *     def connect(self, addr):             # <<<<<<<<<<<<<<
4097
 
 *         """Connect to a remote 0MQ socket.
4098
 
 * 
4099
 
 */
4100
 
 
4101
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_connect(PyObject *__pyx_v_self, PyObject *__pyx_v_addr); /*proto*/
4102
 
static char __pyx_doc_3zmq_4_zmq_6Socket_connect[] = "Connect to a remote 0MQ socket.\n\n        Parameters\n        ----------\n        addr : str\n            The address string. This has the form 'protocol://interface:port',\n            for example 'tcp://127.0.0.1:5555'. Protocols supported are\n            tcp, upd, pgm, inproc and ipc.\n        ";
4103
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_connect(PyObject *__pyx_v_self, PyObject *__pyx_v_addr) {
4104
 
  int __pyx_v_rc;
4105
 
  PyObject *__pyx_r = NULL;
4106
 
  PyObject *__pyx_t_1 = NULL;
4107
 
  PyObject *__pyx_t_2 = NULL;
4108
 
  int __pyx_t_3;
4109
 
  int __pyx_t_4;
4110
 
  char *__pyx_t_5;
4111
 
  __Pyx_RefNannySetupContext("connect");
4112
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
4113
 
  __Pyx_INCREF(__pyx_v_addr);
4114
 
 
4115
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":599
4116
 
 *         cdef int rc
4117
 
 * 
4118
 
 *         self._check_closed()             # <<<<<<<<<<<<<<
4119
 
 * 
4120
 
 *         if not isinstance(addr, str):
4121
 
 */
4122
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4123
 
  __Pyx_GOTREF(__pyx_t_1);
4124
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4125
 
  __Pyx_GOTREF(__pyx_t_2);
4126
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4127
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4128
 
 
4129
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":601
4130
 
 *         self._check_closed()
4131
 
 * 
4132
 
 *         if not isinstance(addr, str):             # <<<<<<<<<<<<<<
4133
 
 *             raise TypeError('expected str, got: %r' % addr)
4134
 
 *         rc = zmq_connect(self.handle, addr)
4135
 
 */
4136
 
  __pyx_t_3 = PyObject_TypeCheck(__pyx_v_addr, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
4137
 
  __pyx_t_4 = (!__pyx_t_3);
4138
 
  if (__pyx_t_4) {
4139
 
 
4140
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":602
4141
 
 * 
4142
 
 *         if not isinstance(addr, str):
4143
 
 *             raise TypeError('expected str, got: %r' % addr)             # <<<<<<<<<<<<<<
4144
 
 *         rc = zmq_connect(self.handle, addr)
4145
 
 *         if rc != 0:
4146
 
 */
4147
 
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_addr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4148
 
    __Pyx_GOTREF(__pyx_t_2);
4149
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4150
 
    __Pyx_GOTREF(__pyx_t_1);
4151
 
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4152
 
    __Pyx_GIVEREF(__pyx_t_2);
4153
 
    __pyx_t_2 = 0;
4154
 
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4155
 
    __Pyx_GOTREF(__pyx_t_2);
4156
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4157
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
4158
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4159
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4160
 
    goto __pyx_L5;
4161
 
  }
4162
 
  __pyx_L5:;
4163
 
 
4164
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":603
4165
 
 *         if not isinstance(addr, str):
4166
 
 *             raise TypeError('expected str, got: %r' % addr)
4167
 
 *         rc = zmq_connect(self.handle, addr)             # <<<<<<<<<<<<<<
4168
 
 *         if rc != 0:
4169
 
 *             raise ZMQError()
4170
 
 */
4171
 
  __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_addr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4172
 
  __pyx_v_rc = zmq_connect(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, __pyx_t_5);
4173
 
 
4174
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":604
4175
 
 *             raise TypeError('expected str, got: %r' % addr)
4176
 
 *         rc = zmq_connect(self.handle, addr)
4177
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
4178
 
 *             raise ZMQError()
4179
 
 * 
4180
 
 */
4181
 
  __pyx_t_4 = (__pyx_v_rc != 0);
4182
 
  if (__pyx_t_4) {
4183
 
 
4184
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":605
4185
 
 *         rc = zmq_connect(self.handle, addr)
4186
 
 *         if rc != 0:
4187
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
4188
 
 * 
4189
 
 *     #-------------------------------------------------------------------------
4190
 
 */
4191
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4192
 
    __Pyx_GOTREF(__pyx_t_2);
4193
 
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4194
 
    __Pyx_GOTREF(__pyx_t_1);
4195
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4196
 
    __Pyx_Raise(__pyx_t_1, 0, 0);
4197
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4198
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4199
 
    goto __pyx_L6;
4200
 
  }
4201
 
  __pyx_L6:;
4202
 
 
4203
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4204
 
  goto __pyx_L0;
4205
 
  __pyx_L1_error:;
4206
 
  __Pyx_XDECREF(__pyx_t_1);
4207
 
  __Pyx_XDECREF(__pyx_t_2);
4208
 
  __Pyx_AddTraceback("zmq._zmq.Socket.connect");
4209
 
  __pyx_r = NULL;
4210
 
  __pyx_L0:;
4211
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
4212
 
  __Pyx_DECREF(__pyx_v_addr);
4213
 
  __Pyx_XGIVEREF(__pyx_r);
4214
 
  __Pyx_RefNannyFinishContext();
4215
 
  return __pyx_r;
4216
 
}
4217
 
 
4218
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":611
4219
 
 *     #-------------------------------------------------------------------------
4220
 
 * 
4221
 
 *     def send(self, object data, int flags=0, bool copy=True):             # <<<<<<<<<<<<<<
4222
 
 *         """Send a message on this socket.
4223
 
 * 
4224
 
 */
4225
 
 
4226
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4227
 
static char __pyx_doc_3zmq_4_zmq_6Socket_send[] = "Send a message on this socket.\n\n        This queues the message to be sent by the IO thread at a later time.\n\n        Parameters\n        ----------\n        data : object, str, Message\n            The content of the message.\n        flags : int\n            Any supported flag: NOBLOCK, SNDMORE.\n        copy : bool\n            Should the message be sent in a copying or non-copying manner.\n\n        Returns\n        -------\n        None if message was sent, raises an exception otherwise.\n        ";
4228
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4229
 
  PyObject *__pyx_v_data = 0;
4230
 
  int __pyx_v_flags;
4231
 
  PyObject *__pyx_v_copy = 0;
4232
 
  PyObject *__pyx_v_msg;
4233
 
  PyObject *__pyx_r = NULL;
4234
 
  PyObject *__pyx_t_1 = NULL;
4235
 
  PyObject *__pyx_t_2 = NULL;
4236
 
  int __pyx_t_3;
4237
 
  PyObject *__pyx_t_4 = NULL;
4238
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__flags,&__pyx_n_s__copy,0};
4239
 
  __Pyx_RefNannySetupContext("send");
4240
 
  if (unlikely(__pyx_kwds)) {
4241
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4242
 
    PyObject* values[3] = {0,0,0};
4243
 
    values[2] = (PyObject*)__pyx_k_5;
4244
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4245
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4246
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4247
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4248
 
      case  0: break;
4249
 
      default: goto __pyx_L5_argtuple_error;
4250
 
    }
4251
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4252
 
      case  0:
4253
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
4254
 
      if (likely(values[0])) kw_args--;
4255
 
      else goto __pyx_L5_argtuple_error;
4256
 
      case  1:
4257
 
      if (kw_args > 1) {
4258
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
4259
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
4260
 
      }
4261
 
      case  2:
4262
 
      if (kw_args > 1) {
4263
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__copy);
4264
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
4265
 
      }
4266
 
    }
4267
 
    if (unlikely(kw_args > 0)) {
4268
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4269
 
    }
4270
 
    __pyx_v_data = values[0];
4271
 
    if (values[1]) {
4272
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4273
 
    } else {
4274
 
      __pyx_v_flags = ((int)0);
4275
 
    }
4276
 
    __pyx_v_copy = ((PyObject *)values[2]);
4277
 
  } else {
4278
 
    __pyx_v_flags = ((int)0);
4279
 
    __pyx_v_copy = __pyx_k_5;
4280
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4281
 
      case  3: __pyx_v_copy = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 2));
4282
 
      case  2: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4283
 
      case  1: __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
4284
 
      break;
4285
 
      default: goto __pyx_L5_argtuple_error;
4286
 
    }
4287
 
  }
4288
 
  goto __pyx_L4_argument_unpacking_done;
4289
 
  __pyx_L5_argtuple_error:;
4290
 
  __Pyx_RaiseArgtupleInvalid("send", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4291
 
  __pyx_L3_error:;
4292
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send");
4293
 
  return NULL;
4294
 
  __pyx_L4_argument_unpacking_done:;
4295
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
4296
 
  __Pyx_INCREF(__pyx_v_data);
4297
 
  __Pyx_INCREF(__pyx_v_copy);
4298
 
  __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
4299
 
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_copy), &PyBool_Type, 1, "copy", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4300
 
 
4301
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":629
4302
 
 *         None if message was sent, raises an exception otherwise.
4303
 
 *         """
4304
 
 *         self._check_closed()             # <<<<<<<<<<<<<<
4305
 
 *         if isinstance(data, Message):
4306
 
 *             return self._send_message(data, flags)
4307
 
 */
4308
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4309
 
  __Pyx_GOTREF(__pyx_t_1);
4310
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4311
 
  __Pyx_GOTREF(__pyx_t_2);
4312
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4313
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4314
 
 
4315
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":630
4316
 
 *         """
4317
 
 *         self._check_closed()
4318
 
 *         if isinstance(data, Message):             # <<<<<<<<<<<<<<
4319
 
 *             return self._send_message(data, flags)
4320
 
 *         elif copy:
4321
 
 */
4322
 
  __pyx_t_3 = PyObject_TypeCheck(__pyx_v_data, ((PyTypeObject *)((PyObject*)__pyx_ptype_3zmq_4_zmq_Message))); 
4323
 
  if (__pyx_t_3) {
4324
 
 
4325
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":631
4326
 
 *         self._check_closed()
4327
 
 *         if isinstance(data, Message):
4328
 
 *             return self._send_message(data, flags)             # <<<<<<<<<<<<<<
4329
 
 *         elif copy:
4330
 
 *             return self._send_copy(data, flags)
4331
 
 */
4332
 
    __Pyx_XDECREF(__pyx_r);
4333
 
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___send_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4334
 
    __Pyx_GOTREF(__pyx_t_2);
4335
 
    __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4336
 
    __Pyx_GOTREF(__pyx_t_1);
4337
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4338
 
    __Pyx_GOTREF(__pyx_t_4);
4339
 
    __Pyx_INCREF(__pyx_v_data);
4340
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
4341
 
    __Pyx_GIVEREF(__pyx_v_data);
4342
 
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
4343
 
    __Pyx_GIVEREF(__pyx_t_1);
4344
 
    __pyx_t_1 = 0;
4345
 
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4346
 
    __Pyx_GOTREF(__pyx_t_1);
4347
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4348
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4349
 
    __pyx_r = __pyx_t_1;
4350
 
    __pyx_t_1 = 0;
4351
 
    goto __pyx_L0;
4352
 
    goto __pyx_L6;
4353
 
  }
4354
 
 
4355
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":632
4356
 
 *         if isinstance(data, Message):
4357
 
 *             return self._send_message(data, flags)
4358
 
 *         elif copy:             # <<<<<<<<<<<<<<
4359
 
 *             return self._send_copy(data, flags)
4360
 
 *         else:
4361
 
 */
4362
 
  __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_copy)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4363
 
  if (__pyx_t_3) {
4364
 
 
4365
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":633
4366
 
 *             return self._send_message(data, flags)
4367
 
 *         elif copy:
4368
 
 *             return self._send_copy(data, flags)             # <<<<<<<<<<<<<<
4369
 
 *         else:
4370
 
 *             # I am not sure which non-copy implemntation to use here.
4371
 
 */
4372
 
    __Pyx_XDECREF(__pyx_r);
4373
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___send_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4374
 
    __Pyx_GOTREF(__pyx_t_1);
4375
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4376
 
    __Pyx_GOTREF(__pyx_t_4);
4377
 
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4378
 
    __Pyx_GOTREF(__pyx_t_2);
4379
 
    __Pyx_INCREF(__pyx_v_data);
4380
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
4381
 
    __Pyx_GIVEREF(__pyx_v_data);
4382
 
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
4383
 
    __Pyx_GIVEREF(__pyx_t_4);
4384
 
    __pyx_t_4 = 0;
4385
 
    __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4386
 
    __Pyx_GOTREF(__pyx_t_4);
4387
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4388
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4389
 
    __pyx_r = __pyx_t_4;
4390
 
    __pyx_t_4 = 0;
4391
 
    goto __pyx_L0;
4392
 
    goto __pyx_L6;
4393
 
  }
4394
 
  /*else*/ {
4395
 
 
4396
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":637
4397
 
 *             # I am not sure which non-copy implemntation to use here.
4398
 
 *             # It probably doesn't matter though.
4399
 
 *             msg = Message(data)             # <<<<<<<<<<<<<<
4400
 
 *             return self._send_message(msg, flags)
4401
 
 *             # return self._send_nocopy(msg, flags)
4402
 
 */
4403
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4404
 
    __Pyx_GOTREF(__pyx_t_4);
4405
 
    __Pyx_INCREF(__pyx_v_data);
4406
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
4407
 
    __Pyx_GIVEREF(__pyx_v_data);
4408
 
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3zmq_4_zmq_Message)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4409
 
    __Pyx_GOTREF(__pyx_t_2);
4410
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4411
 
    __Pyx_DECREF(__pyx_v_msg);
4412
 
    __pyx_v_msg = __pyx_t_2;
4413
 
    __pyx_t_2 = 0;
4414
 
 
4415
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":638
4416
 
 *             # It probably doesn't matter though.
4417
 
 *             msg = Message(data)
4418
 
 *             return self._send_message(msg, flags)             # <<<<<<<<<<<<<<
4419
 
 *             # return self._send_nocopy(msg, flags)
4420
 
 * 
4421
 
 */
4422
 
    __Pyx_XDECREF(__pyx_r);
4423
 
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___send_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4424
 
    __Pyx_GOTREF(__pyx_t_2);
4425
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4426
 
    __Pyx_GOTREF(__pyx_t_4);
4427
 
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4428
 
    __Pyx_GOTREF(__pyx_t_1);
4429
 
    __Pyx_INCREF(__pyx_v_msg);
4430
 
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg);
4431
 
    __Pyx_GIVEREF(__pyx_v_msg);
4432
 
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
4433
 
    __Pyx_GIVEREF(__pyx_t_4);
4434
 
    __pyx_t_4 = 0;
4435
 
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4436
 
    __Pyx_GOTREF(__pyx_t_4);
4437
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4438
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4439
 
    __pyx_r = __pyx_t_4;
4440
 
    __pyx_t_4 = 0;
4441
 
    goto __pyx_L0;
4442
 
  }
4443
 
  __pyx_L6:;
4444
 
 
4445
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4446
 
  goto __pyx_L0;
4447
 
  __pyx_L1_error:;
4448
 
  __Pyx_XDECREF(__pyx_t_1);
4449
 
  __Pyx_XDECREF(__pyx_t_2);
4450
 
  __Pyx_XDECREF(__pyx_t_4);
4451
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send");
4452
 
  __pyx_r = NULL;
4453
 
  __pyx_L0:;
4454
 
  __Pyx_DECREF(__pyx_v_msg);
4455
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
4456
 
  __Pyx_DECREF(__pyx_v_data);
4457
 
  __Pyx_DECREF(__pyx_v_copy);
4458
 
  __Pyx_XGIVEREF(__pyx_r);
4459
 
  __Pyx_RefNannyFinishContext();
4460
 
  return __pyx_r;
4461
 
}
4462
 
 
4463
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":641
4464
 
 *             # return self._send_nocopy(msg, flags)
4465
 
 * 
4466
 
 *     def _send_message(self, Message msg, int flags=0):             # <<<<<<<<<<<<<<
4467
 
 *         """Send a Message on this socket in a non-copy manner."""
4468
 
 *         cdef int rc
4469
 
 */
4470
 
 
4471
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__send_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4472
 
static char __pyx_doc_3zmq_4_zmq_6Socket__send_message[] = "Send a Message on this socket in a non-copy manner.";
4473
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__send_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4474
 
  struct __pyx_obj_3zmq_4_zmq_Message *__pyx_v_msg = 0;
4475
 
  int __pyx_v_flags;
4476
 
  int __pyx_v_rc;
4477
 
  struct __pyx_obj_3zmq_4_zmq_Message *__pyx_v_msg_copy;
4478
 
  PyObject *__pyx_r = NULL;
4479
 
  PyObject *__pyx_t_1 = NULL;
4480
 
  int __pyx_t_2;
4481
 
  PyObject *__pyx_t_3 = NULL;
4482
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__msg,&__pyx_n_s__flags,0};
4483
 
  __Pyx_RefNannySetupContext("_send_message");
4484
 
  if (unlikely(__pyx_kwds)) {
4485
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4486
 
    PyObject* values[2] = {0,0};
4487
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4488
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4489
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4490
 
      case  0: break;
4491
 
      default: goto __pyx_L5_argtuple_error;
4492
 
    }
4493
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4494
 
      case  0:
4495
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg);
4496
 
      if (likely(values[0])) kw_args--;
4497
 
      else goto __pyx_L5_argtuple_error;
4498
 
      case  1:
4499
 
      if (kw_args > 1) {
4500
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
4501
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
4502
 
      }
4503
 
    }
4504
 
    if (unlikely(kw_args > 0)) {
4505
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_send_message") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4506
 
    }
4507
 
    __pyx_v_msg = ((struct __pyx_obj_3zmq_4_zmq_Message *)values[0]);
4508
 
    if (values[1]) {
4509
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4510
 
    } else {
4511
 
      __pyx_v_flags = ((int)0);
4512
 
    }
4513
 
  } else {
4514
 
    __pyx_v_flags = ((int)0);
4515
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4516
 
      case  2: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4517
 
      case  1: __pyx_v_msg = ((struct __pyx_obj_3zmq_4_zmq_Message *)PyTuple_GET_ITEM(__pyx_args, 0));
4518
 
      break;
4519
 
      default: goto __pyx_L5_argtuple_error;
4520
 
    }
4521
 
  }
4522
 
  goto __pyx_L4_argument_unpacking_done;
4523
 
  __pyx_L5_argtuple_error:;
4524
 
  __Pyx_RaiseArgtupleInvalid("_send_message", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4525
 
  __pyx_L3_error:;
4526
 
  __Pyx_AddTraceback("zmq._zmq.Socket._send_message");
4527
 
  return NULL;
4528
 
  __pyx_L4_argument_unpacking_done:;
4529
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
4530
 
  __Pyx_INCREF((PyObject *)__pyx_v_msg);
4531
 
  __pyx_v_msg_copy = ((struct __pyx_obj_3zmq_4_zmq_Message *)Py_None); __Pyx_INCREF(Py_None);
4532
 
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_msg), __pyx_ptype_3zmq_4_zmq_Message, 1, "msg", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4533
 
 
4534
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":648
4535
 
 *         # Always copy so the original message isn't garbage collected.
4536
 
 *         # This doesn't do a real copy, just a reference.
4537
 
 *         msg_copy = msg.fast_copy()             # <<<<<<<<<<<<<<
4538
 
 *         # msg_copy = copy_mod.copy(msg)
4539
 
 *         with nogil:
4540
 
 */
4541
 
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3zmq_4_zmq_Message *)__pyx_v_msg->__pyx_vtab)->fast_copy(__pyx_v_msg)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4542
 
  __Pyx_GOTREF(__pyx_t_1);
4543
 
  __Pyx_DECREF(((PyObject *)__pyx_v_msg_copy));
4544
 
  __pyx_v_msg_copy = ((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_t_1);
4545
 
  __pyx_t_1 = 0;
4546
 
 
4547
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":650
4548
 
 *         msg_copy = msg.fast_copy()
4549
 
 *         # msg_copy = copy_mod.copy(msg)
4550
 
 *         with nogil:             # <<<<<<<<<<<<<<
4551
 
 *             rc = zmq_send(self.handle, &msg.zmq_msg, flags)
4552
 
 * 
4553
 
 */
4554
 
  { PyThreadState *_save;
4555
 
    Py_UNBLOCK_THREADS
4556
 
    /*try:*/ {
4557
 
 
4558
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":651
4559
 
 *         # msg_copy = copy_mod.copy(msg)
4560
 
 *         with nogil:
4561
 
 *             rc = zmq_send(self.handle, &msg.zmq_msg, flags)             # <<<<<<<<<<<<<<
4562
 
 * 
4563
 
 *         if rc != 0:
4564
 
 */
4565
 
      __pyx_v_rc = zmq_send(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, (&__pyx_v_msg->zmq_msg), __pyx_v_flags);
4566
 
    }
4567
 
    /*finally:*/ {
4568
 
 
4569
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":650
4570
 
 *         msg_copy = msg.fast_copy()
4571
 
 *         # msg_copy = copy_mod.copy(msg)
4572
 
 *         with nogil:             # <<<<<<<<<<<<<<
4573
 
 *             rc = zmq_send(self.handle, &msg.zmq_msg, flags)
4574
 
 * 
4575
 
 */
4576
 
      Py_BLOCK_THREADS
4577
 
    }
4578
 
  }
4579
 
 
4580
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":653
4581
 
 *             rc = zmq_send(self.handle, &msg.zmq_msg, flags)
4582
 
 * 
4583
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
4584
 
 *             raise ZMQError()
4585
 
 * 
4586
 
 */
4587
 
  __pyx_t_2 = (__pyx_v_rc != 0);
4588
 
  if (__pyx_t_2) {
4589
 
 
4590
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":654
4591
 
 * 
4592
 
 *         if rc != 0:
4593
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
4594
 
 * 
4595
 
 *     def _send_copy(self, object msg, int flags=0):
4596
 
 */
4597
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4598
 
    __Pyx_GOTREF(__pyx_t_1);
4599
 
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4600
 
    __Pyx_GOTREF(__pyx_t_3);
4601
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4602
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
4603
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4604
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4605
 
    goto __pyx_L9;
4606
 
  }
4607
 
  __pyx_L9:;
4608
 
 
4609
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4610
 
  goto __pyx_L0;
4611
 
  __pyx_L1_error:;
4612
 
  __Pyx_XDECREF(__pyx_t_1);
4613
 
  __Pyx_XDECREF(__pyx_t_3);
4614
 
  __Pyx_AddTraceback("zmq._zmq.Socket._send_message");
4615
 
  __pyx_r = NULL;
4616
 
  __pyx_L0:;
4617
 
  __Pyx_DECREF((PyObject *)__pyx_v_msg_copy);
4618
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
4619
 
  __Pyx_DECREF((PyObject *)__pyx_v_msg);
4620
 
  __Pyx_XGIVEREF(__pyx_r);
4621
 
  __Pyx_RefNannyFinishContext();
4622
 
  return __pyx_r;
4623
 
}
4624
 
 
4625
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":656
4626
 
 *             raise ZMQError()
4627
 
 * 
4628
 
 *     def _send_copy(self, object msg, int flags=0):             # <<<<<<<<<<<<<<
4629
 
 *         """Send a message on this socket by copying its content."""
4630
 
 *         cdef int rc, rc2
4631
 
 */
4632
 
 
4633
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__send_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4634
 
static char __pyx_doc_3zmq_4_zmq_6Socket__send_copy[] = "Send a message on this socket by copying its content.";
4635
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__send_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4636
 
  PyObject *__pyx_v_msg = 0;
4637
 
  int __pyx_v_flags;
4638
 
  int __pyx_v_rc;
4639
 
  int __pyx_v_rc2;
4640
 
  zmq_msg_t __pyx_v_data;
4641
 
  char *__pyx_v_msg_c;
4642
 
  Py_ssize_t __pyx_v_msg_c_len;
4643
 
  PyObject *__pyx_r = NULL;
4644
 
  int __pyx_t_1;
4645
 
  int __pyx_t_2;
4646
 
  PyObject *__pyx_t_3 = NULL;
4647
 
  PyObject *__pyx_t_4 = NULL;
4648
 
  int __pyx_t_5;
4649
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__msg,&__pyx_n_s__flags,0};
4650
 
  __Pyx_RefNannySetupContext("_send_copy");
4651
 
  if (unlikely(__pyx_kwds)) {
4652
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4653
 
    PyObject* values[2] = {0,0};
4654
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4655
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4656
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4657
 
      case  0: break;
4658
 
      default: goto __pyx_L5_argtuple_error;
4659
 
    }
4660
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4661
 
      case  0:
4662
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg);
4663
 
      if (likely(values[0])) kw_args--;
4664
 
      else goto __pyx_L5_argtuple_error;
4665
 
      case  1:
4666
 
      if (kw_args > 1) {
4667
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
4668
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
4669
 
      }
4670
 
    }
4671
 
    if (unlikely(kw_args > 0)) {
4672
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_send_copy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4673
 
    }
4674
 
    __pyx_v_msg = values[0];
4675
 
    if (values[1]) {
4676
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4677
 
    } else {
4678
 
      __pyx_v_flags = ((int)0);
4679
 
    }
4680
 
  } else {
4681
 
    __pyx_v_flags = ((int)0);
4682
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4683
 
      case  2: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4684
 
      case  1: __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 0);
4685
 
      break;
4686
 
      default: goto __pyx_L5_argtuple_error;
4687
 
    }
4688
 
  }
4689
 
  goto __pyx_L4_argument_unpacking_done;
4690
 
  __pyx_L5_argtuple_error:;
4691
 
  __Pyx_RaiseArgtupleInvalid("_send_copy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4692
 
  __pyx_L3_error:;
4693
 
  __Pyx_AddTraceback("zmq._zmq.Socket._send_copy");
4694
 
  return NULL;
4695
 
  __pyx_L4_argument_unpacking_done:;
4696
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
4697
 
  __Pyx_INCREF(__pyx_v_msg);
4698
 
 
4699
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":663
4700
 
 *         cdef Py_ssize_t msg_c_len
4701
 
 * 
4702
 
 *         if not isinstance(msg, str):             # <<<<<<<<<<<<<<
4703
 
 *             raise TypeError('expected str, got: %r' % msg)
4704
 
 * 
4705
 
 */
4706
 
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_msg, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
4707
 
  __pyx_t_2 = (!__pyx_t_1);
4708
 
  if (__pyx_t_2) {
4709
 
 
4710
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":664
4711
 
 * 
4712
 
 *         if not isinstance(msg, str):
4713
 
 *             raise TypeError('expected str, got: %r' % msg)             # <<<<<<<<<<<<<<
4714
 
 * 
4715
 
 *         PyString_AsStringAndSize(msg, &msg_c, &msg_c_len)
4716
 
 */
4717
 
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4718
 
    __Pyx_GOTREF(__pyx_t_3);
4719
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4720
 
    __Pyx_GOTREF(__pyx_t_4);
4721
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
4722
 
    __Pyx_GIVEREF(__pyx_t_3);
4723
 
    __pyx_t_3 = 0;
4724
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4725
 
    __Pyx_GOTREF(__pyx_t_3);
4726
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4727
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
4728
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4729
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4730
 
    goto __pyx_L6;
4731
 
  }
4732
 
  __pyx_L6:;
4733
 
 
4734
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":666
4735
 
 *             raise TypeError('expected str, got: %r' % msg)
4736
 
 * 
4737
 
 *         PyString_AsStringAndSize(msg, &msg_c, &msg_c_len)             # <<<<<<<<<<<<<<
4738
 
 *         # Copy the msg before sending. This avoids any complications with
4739
 
 *         # the GIL, etc.
4740
 
 */
4741
 
  __pyx_t_5 = PyString_AsStringAndSize(__pyx_v_msg, (&__pyx_v_msg_c), (&__pyx_v_msg_c_len)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4742
 
 
4743
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":670
4744
 
 *         # the GIL, etc.
4745
 
 *         # If zmq_msg_init_* fails do we need to call zmq_msg_close?
4746
 
 *         rc = zmq_msg_init_size(&data, msg_c_len)             # <<<<<<<<<<<<<<
4747
 
 *         memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
4748
 
 * 
4749
 
 */
4750
 
  __pyx_v_rc = zmq_msg_init_size((&__pyx_v_data), __pyx_v_msg_c_len);
4751
 
 
4752
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":671
4753
 
 *         # If zmq_msg_init_* fails do we need to call zmq_msg_close?
4754
 
 *         rc = zmq_msg_init_size(&data, msg_c_len)
4755
 
 *         memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))             # <<<<<<<<<<<<<<
4756
 
 * 
4757
 
 *         if rc != 0:
4758
 
 */
4759
 
  memcpy(zmq_msg_data((&__pyx_v_data)), __pyx_v_msg_c, zmq_msg_size((&__pyx_v_data)));
4760
 
 
4761
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":673
4762
 
 *         memcpy(zmq_msg_data(&data), msg_c, zmq_msg_size(&data))
4763
 
 * 
4764
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
4765
 
 *             raise ZMQError()
4766
 
 * 
4767
 
 */
4768
 
  __pyx_t_2 = (__pyx_v_rc != 0);
4769
 
  if (__pyx_t_2) {
4770
 
 
4771
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":674
4772
 
 * 
4773
 
 *         if rc != 0:
4774
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
4775
 
 * 
4776
 
 *         with nogil:
4777
 
 */
4778
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4779
 
    __Pyx_GOTREF(__pyx_t_3);
4780
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4781
 
    __Pyx_GOTREF(__pyx_t_4);
4782
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4783
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
4784
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4785
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4786
 
    goto __pyx_L7;
4787
 
  }
4788
 
  __pyx_L7:;
4789
 
 
4790
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":676
4791
 
 *             raise ZMQError()
4792
 
 * 
4793
 
 *         with nogil:             # <<<<<<<<<<<<<<
4794
 
 *             rc = zmq_send(self.handle, &data, flags)
4795
 
 *         rc2 = zmq_msg_close(&data)
4796
 
 */
4797
 
  { PyThreadState *_save;
4798
 
    Py_UNBLOCK_THREADS
4799
 
    /*try:*/ {
4800
 
 
4801
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":677
4802
 
 * 
4803
 
 *         with nogil:
4804
 
 *             rc = zmq_send(self.handle, &data, flags)             # <<<<<<<<<<<<<<
4805
 
 *         rc2 = zmq_msg_close(&data)
4806
 
 * 
4807
 
 */
4808
 
      __pyx_v_rc = zmq_send(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, (&__pyx_v_data), __pyx_v_flags);
4809
 
    }
4810
 
    /*finally:*/ {
4811
 
 
4812
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":676
4813
 
 *             raise ZMQError()
4814
 
 * 
4815
 
 *         with nogil:             # <<<<<<<<<<<<<<
4816
 
 *             rc = zmq_send(self.handle, &data, flags)
4817
 
 *         rc2 = zmq_msg_close(&data)
4818
 
 */
4819
 
      Py_BLOCK_THREADS
4820
 
    }
4821
 
  }
4822
 
 
4823
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":678
4824
 
 *         with nogil:
4825
 
 *             rc = zmq_send(self.handle, &data, flags)
4826
 
 *         rc2 = zmq_msg_close(&data)             # <<<<<<<<<<<<<<
4827
 
 * 
4828
 
 *         # Shouldn't the error handling for zmq_msg_close come after that
4829
 
 */
4830
 
  __pyx_v_rc2 = zmq_msg_close((&__pyx_v_data));
4831
 
 
4832
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":682
4833
 
 *         # Shouldn't the error handling for zmq_msg_close come after that
4834
 
 *         # of zmq_send?
4835
 
 *         if rc2 != 0:             # <<<<<<<<<<<<<<
4836
 
 *             raise ZMQError()
4837
 
 * 
4838
 
 */
4839
 
  __pyx_t_2 = (__pyx_v_rc2 != 0);
4840
 
  if (__pyx_t_2) {
4841
 
 
4842
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":683
4843
 
 *         # of zmq_send?
4844
 
 *         if rc2 != 0:
4845
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
4846
 
 * 
4847
 
 *         if rc != 0:
4848
 
 */
4849
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4850
 
    __Pyx_GOTREF(__pyx_t_4);
4851
 
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4852
 
    __Pyx_GOTREF(__pyx_t_3);
4853
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4854
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
4855
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4856
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4857
 
    goto __pyx_L11;
4858
 
  }
4859
 
  __pyx_L11:;
4860
 
 
4861
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":685
4862
 
 *             raise ZMQError()
4863
 
 * 
4864
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
4865
 
 *             raise ZMQError()
4866
 
 * 
4867
 
 */
4868
 
  __pyx_t_2 = (__pyx_v_rc != 0);
4869
 
  if (__pyx_t_2) {
4870
 
 
4871
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":686
4872
 
 * 
4873
 
 *         if rc != 0:
4874
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
4875
 
 * 
4876
 
 *     def _send_nocopy(self, object msg, int flags=0):
4877
 
 */
4878
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4879
 
    __Pyx_GOTREF(__pyx_t_3);
4880
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4881
 
    __Pyx_GOTREF(__pyx_t_4);
4882
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4883
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
4884
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4885
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4886
 
    goto __pyx_L12;
4887
 
  }
4888
 
  __pyx_L12:;
4889
 
 
4890
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4891
 
  goto __pyx_L0;
4892
 
  __pyx_L1_error:;
4893
 
  __Pyx_XDECREF(__pyx_t_3);
4894
 
  __Pyx_XDECREF(__pyx_t_4);
4895
 
  __Pyx_AddTraceback("zmq._zmq.Socket._send_copy");
4896
 
  __pyx_r = NULL;
4897
 
  __pyx_L0:;
4898
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
4899
 
  __Pyx_DECREF(__pyx_v_msg);
4900
 
  __Pyx_XGIVEREF(__pyx_r);
4901
 
  __Pyx_RefNannyFinishContext();
4902
 
  return __pyx_r;
4903
 
}
4904
 
 
4905
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":688
4906
 
 *             raise ZMQError()
4907
 
 * 
4908
 
 *     def _send_nocopy(self, object msg, int flags=0):             # <<<<<<<<<<<<<<
4909
 
 *         """Send a Python string on this socket in a non-copy manner.
4910
 
 * 
4911
 
 */
4912
 
 
4913
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__send_nocopy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4914
 
static char __pyx_doc_3zmq_4_zmq_6Socket__send_nocopy[] = "Send a Python string on this socket in a non-copy manner.\n\n        This method is not being used currently, as the same functionality\n        is provided by self._send_message(Message(data)). This may eventually\n        be removed.\n        ";
4915
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__send_nocopy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4916
 
  PyObject *__pyx_v_msg = 0;
4917
 
  int __pyx_v_flags;
4918
 
  int __pyx_v_rc;
4919
 
  zmq_msg_t __pyx_v_data;
4920
 
  char *__pyx_v_msg_c;
4921
 
  Py_ssize_t __pyx_v_msg_c_len;
4922
 
  PyObject *__pyx_r = NULL;
4923
 
  int __pyx_t_1;
4924
 
  int __pyx_t_2;
4925
 
  PyObject *__pyx_t_3 = NULL;
4926
 
  PyObject *__pyx_t_4 = NULL;
4927
 
  int __pyx_t_5;
4928
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__msg,&__pyx_n_s__flags,0};
4929
 
  __Pyx_RefNannySetupContext("_send_nocopy");
4930
 
  if (unlikely(__pyx_kwds)) {
4931
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
4932
 
    PyObject* values[2] = {0,0};
4933
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4934
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4935
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4936
 
      case  0: break;
4937
 
      default: goto __pyx_L5_argtuple_error;
4938
 
    }
4939
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4940
 
      case  0:
4941
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg);
4942
 
      if (likely(values[0])) kw_args--;
4943
 
      else goto __pyx_L5_argtuple_error;
4944
 
      case  1:
4945
 
      if (kw_args > 1) {
4946
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
4947
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
4948
 
      }
4949
 
    }
4950
 
    if (unlikely(kw_args > 0)) {
4951
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_send_nocopy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4952
 
    }
4953
 
    __pyx_v_msg = values[0];
4954
 
    if (values[1]) {
4955
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4956
 
    } else {
4957
 
      __pyx_v_flags = ((int)0);
4958
 
    }
4959
 
  } else {
4960
 
    __pyx_v_flags = ((int)0);
4961
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
4962
 
      case  2: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4963
 
      case  1: __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 0);
4964
 
      break;
4965
 
      default: goto __pyx_L5_argtuple_error;
4966
 
    }
4967
 
  }
4968
 
  goto __pyx_L4_argument_unpacking_done;
4969
 
  __pyx_L5_argtuple_error:;
4970
 
  __Pyx_RaiseArgtupleInvalid("_send_nocopy", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4971
 
  __pyx_L3_error:;
4972
 
  __Pyx_AddTraceback("zmq._zmq.Socket._send_nocopy");
4973
 
  return NULL;
4974
 
  __pyx_L4_argument_unpacking_done:;
4975
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
4976
 
  __Pyx_INCREF(__pyx_v_msg);
4977
 
 
4978
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":700
4979
 
 *         cdef Py_ssize_t msg_c_len
4980
 
 * 
4981
 
 *         if not isinstance(msg, str):             # <<<<<<<<<<<<<<
4982
 
 *             raise TypeError('expected str, got: %r' % msg)
4983
 
 * 
4984
 
 */
4985
 
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_msg, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
4986
 
  __pyx_t_2 = (!__pyx_t_1);
4987
 
  if (__pyx_t_2) {
4988
 
 
4989
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":701
4990
 
 * 
4991
 
 *         if not isinstance(msg, str):
4992
 
 *             raise TypeError('expected str, got: %r' % msg)             # <<<<<<<<<<<<<<
4993
 
 * 
4994
 
 *         PyString_AsStringAndSize(msg, &msg_c, &msg_c_len)
4995
 
 */
4996
 
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4997
 
    __Pyx_GOTREF(__pyx_t_3);
4998
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4999
 
    __Pyx_GOTREF(__pyx_t_4);
5000
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
5001
 
    __Pyx_GIVEREF(__pyx_t_3);
5002
 
    __pyx_t_3 = 0;
5003
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5004
 
    __Pyx_GOTREF(__pyx_t_3);
5005
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5006
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
5007
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5008
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5009
 
    goto __pyx_L6;
5010
 
  }
5011
 
  __pyx_L6:;
5012
 
 
5013
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":703
5014
 
 *             raise TypeError('expected str, got: %r' % msg)
5015
 
 * 
5016
 
 *         PyString_AsStringAndSize(msg, &msg_c, &msg_c_len)             # <<<<<<<<<<<<<<
5017
 
 *         Py_INCREF(msg) # We INCREF to prevent Python from gc'ing msg
5018
 
 *         rc = zmq_msg_init_data(
5019
 
 */
5020
 
  __pyx_t_5 = PyString_AsStringAndSize(__pyx_v_msg, (&__pyx_v_msg_c), (&__pyx_v_msg_c_len)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5021
 
 
5022
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":704
5023
 
 * 
5024
 
 *         PyString_AsStringAndSize(msg, &msg_c, &msg_c_len)
5025
 
 *         Py_INCREF(msg) # We INCREF to prevent Python from gc'ing msg             # <<<<<<<<<<<<<<
5026
 
 *         rc = zmq_msg_init_data(
5027
 
 *             &data, <void *>msg_c, msg_c_len,
5028
 
 */
5029
 
  Py_INCREF(__pyx_v_msg);
5030
 
 
5031
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":708
5032
 
 *             &data, <void *>msg_c, msg_c_len,
5033
 
 *             <zmq_free_fn *>free_python_msg, <void *>msg
5034
 
 *         )             # <<<<<<<<<<<<<<
5035
 
 * 
5036
 
 *         if rc != 0:
5037
 
 */
5038
 
  __pyx_v_rc = zmq_msg_init_data((&__pyx_v_data), ((void *)__pyx_v_msg_c), __pyx_v_msg_c_len, ((zmq_free_fn *)__pyx_f_3zmq_4_zmq_free_python_msg), ((void *)__pyx_v_msg));
5039
 
 
5040
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":710
5041
 
 *         )
5042
 
 * 
5043
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5044
 
 *             # If zmq_msg_init_data fails it does not call zmq_free_fn,
5045
 
 *             # so we Py_DECREF.
5046
 
 */
5047
 
  __pyx_t_2 = (__pyx_v_rc != 0);
5048
 
  if (__pyx_t_2) {
5049
 
 
5050
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":713
5051
 
 *             # If zmq_msg_init_data fails it does not call zmq_free_fn,
5052
 
 *             # so we Py_DECREF.
5053
 
 *             Py_DECREF(msg)             # <<<<<<<<<<<<<<
5054
 
 *             raise ZMQError()
5055
 
 * 
5056
 
 */
5057
 
    Py_DECREF(__pyx_v_msg);
5058
 
 
5059
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":714
5060
 
 *             # so we Py_DECREF.
5061
 
 *             Py_DECREF(msg)
5062
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5063
 
 * 
5064
 
 *         with nogil:
5065
 
 */
5066
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5067
 
    __Pyx_GOTREF(__pyx_t_3);
5068
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5069
 
    __Pyx_GOTREF(__pyx_t_4);
5070
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5071
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
5072
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5073
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5074
 
    goto __pyx_L7;
5075
 
  }
5076
 
  __pyx_L7:;
5077
 
 
5078
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":716
5079
 
 *             raise ZMQError()
5080
 
 * 
5081
 
 *         with nogil:             # <<<<<<<<<<<<<<
5082
 
 *             rc = zmq_send(self.handle, &data, flags)
5083
 
 * 
5084
 
 */
5085
 
  { PyThreadState *_save;
5086
 
    Py_UNBLOCK_THREADS
5087
 
    /*try:*/ {
5088
 
 
5089
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":717
5090
 
 * 
5091
 
 *         with nogil:
5092
 
 *             rc = zmq_send(self.handle, &data, flags)             # <<<<<<<<<<<<<<
5093
 
 * 
5094
 
 *         if rc != 0:
5095
 
 */
5096
 
      __pyx_v_rc = zmq_send(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, (&__pyx_v_data), __pyx_v_flags);
5097
 
    }
5098
 
    /*finally:*/ {
5099
 
 
5100
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":716
5101
 
 *             raise ZMQError()
5102
 
 * 
5103
 
 *         with nogil:             # <<<<<<<<<<<<<<
5104
 
 *             rc = zmq_send(self.handle, &data, flags)
5105
 
 * 
5106
 
 */
5107
 
      Py_BLOCK_THREADS
5108
 
    }
5109
 
  }
5110
 
 
5111
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":719
5112
 
 *             rc = zmq_send(self.handle, &data, flags)
5113
 
 * 
5114
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5115
 
 *             # If zmq_send fails it does not call zmq_free_fn, so we Py_DECREF.
5116
 
 *             Py_DECREF(msg)
5117
 
 */
5118
 
  __pyx_t_2 = (__pyx_v_rc != 0);
5119
 
  if (__pyx_t_2) {
5120
 
 
5121
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":721
5122
 
 *         if rc != 0:
5123
 
 *             # If zmq_send fails it does not call zmq_free_fn, so we Py_DECREF.
5124
 
 *             Py_DECREF(msg)             # <<<<<<<<<<<<<<
5125
 
 *             zmq_msg_close(&data)
5126
 
 *             raise ZMQError()
5127
 
 */
5128
 
    Py_DECREF(__pyx_v_msg);
5129
 
 
5130
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":722
5131
 
 *             # If zmq_send fails it does not call zmq_free_fn, so we Py_DECREF.
5132
 
 *             Py_DECREF(msg)
5133
 
 *             zmq_msg_close(&data)             # <<<<<<<<<<<<<<
5134
 
 *             raise ZMQError()
5135
 
 * 
5136
 
 */
5137
 
    zmq_msg_close((&__pyx_v_data));
5138
 
 
5139
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":723
5140
 
 *             Py_DECREF(msg)
5141
 
 *             zmq_msg_close(&data)
5142
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5143
 
 * 
5144
 
 *         rc = zmq_msg_close(&data)
5145
 
 */
5146
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5147
 
    __Pyx_GOTREF(__pyx_t_4);
5148
 
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5149
 
    __Pyx_GOTREF(__pyx_t_3);
5150
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5151
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
5152
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5153
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5154
 
    goto __pyx_L11;
5155
 
  }
5156
 
  __pyx_L11:;
5157
 
 
5158
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":725
5159
 
 *             raise ZMQError()
5160
 
 * 
5161
 
 *         rc = zmq_msg_close(&data)             # <<<<<<<<<<<<<<
5162
 
 *         if rc != 0:
5163
 
 *             raise ZMQError()
5164
 
 */
5165
 
  __pyx_v_rc = zmq_msg_close((&__pyx_v_data));
5166
 
 
5167
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":726
5168
 
 * 
5169
 
 *         rc = zmq_msg_close(&data)
5170
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5171
 
 *             raise ZMQError()
5172
 
 * 
5173
 
 */
5174
 
  __pyx_t_2 = (__pyx_v_rc != 0);
5175
 
  if (__pyx_t_2) {
5176
 
 
5177
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":727
5178
 
 *         rc = zmq_msg_close(&data)
5179
 
 *         if rc != 0:
5180
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5181
 
 * 
5182
 
 *     def recv(self, int flags=0, copy=True):
5183
 
 */
5184
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5185
 
    __Pyx_GOTREF(__pyx_t_3);
5186
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5187
 
    __Pyx_GOTREF(__pyx_t_4);
5188
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5189
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
5190
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5191
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5192
 
    goto __pyx_L12;
5193
 
  }
5194
 
  __pyx_L12:;
5195
 
 
5196
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5197
 
  goto __pyx_L0;
5198
 
  __pyx_L1_error:;
5199
 
  __Pyx_XDECREF(__pyx_t_3);
5200
 
  __Pyx_XDECREF(__pyx_t_4);
5201
 
  __Pyx_AddTraceback("zmq._zmq.Socket._send_nocopy");
5202
 
  __pyx_r = NULL;
5203
 
  __pyx_L0:;
5204
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
5205
 
  __Pyx_DECREF(__pyx_v_msg);
5206
 
  __Pyx_XGIVEREF(__pyx_r);
5207
 
  __Pyx_RefNannyFinishContext();
5208
 
  return __pyx_r;
5209
 
}
5210
 
 
5211
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":729
5212
 
 *             raise ZMQError()
5213
 
 * 
5214
 
 *     def recv(self, int flags=0, copy=True):             # <<<<<<<<<<<<<<
5215
 
 *         """Receive a message.
5216
 
 * 
5217
 
 */
5218
 
 
5219
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5220
 
static char __pyx_doc_3zmq_4_zmq_6Socket_recv[] = "Receive a message.\n\n        Parameters\n        ----------\n        flags : int\n            Any supported flag: NOBLOCK. If NOBLOCK is set, this method\n            will return None if a message is not ready. If NOBLOCK is not\n            set, then this method will block until a message arrives.\n        copy : bool\n            Should the message be received in a copying or non-copying manner.\n            If True a Message object is returned, if False a string copy of \n            message is returned.\n        Returns\n        -------\n        msg : str\n            The returned message, or raises ZMQError otherwise.\n        ";
5221
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5222
 
  int __pyx_v_flags;
5223
 
  PyObject *__pyx_v_copy = 0;
5224
 
  PyObject *__pyx_r = NULL;
5225
 
  PyObject *__pyx_t_1 = NULL;
5226
 
  PyObject *__pyx_t_2 = NULL;
5227
 
  int __pyx_t_3;
5228
 
  PyObject *__pyx_t_4 = NULL;
5229
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flags,&__pyx_n_s__copy,0};
5230
 
  __Pyx_RefNannySetupContext("recv");
5231
 
  if (unlikely(__pyx_kwds)) {
5232
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5233
 
    PyObject* values[2] = {0,0};
5234
 
    values[1] = __pyx_k_6;
5235
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5236
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5237
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5238
 
      case  0: break;
5239
 
      default: goto __pyx_L5_argtuple_error;
5240
 
    }
5241
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5242
 
      case  0:
5243
 
      if (kw_args > 1) {
5244
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
5245
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
5246
 
      }
5247
 
      case  1:
5248
 
      if (kw_args > 1) {
5249
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__copy);
5250
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
5251
 
      }
5252
 
    }
5253
 
    if (unlikely(kw_args > 0)) {
5254
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "recv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5255
 
    }
5256
 
    if (values[0]) {
5257
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5258
 
    } else {
5259
 
      __pyx_v_flags = ((int)0);
5260
 
    }
5261
 
    __pyx_v_copy = values[1];
5262
 
  } else {
5263
 
    __pyx_v_flags = ((int)0);
5264
 
    __pyx_v_copy = __pyx_k_6;
5265
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5266
 
      case  2: __pyx_v_copy = PyTuple_GET_ITEM(__pyx_args, 1);
5267
 
      case  1: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5268
 
      case  0: break;
5269
 
      default: goto __pyx_L5_argtuple_error;
5270
 
    }
5271
 
  }
5272
 
  goto __pyx_L4_argument_unpacking_done;
5273
 
  __pyx_L5_argtuple_error:;
5274
 
  __Pyx_RaiseArgtupleInvalid("recv", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5275
 
  __pyx_L3_error:;
5276
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv");
5277
 
  return NULL;
5278
 
  __pyx_L4_argument_unpacking_done:;
5279
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
5280
 
  __Pyx_INCREF(__pyx_v_copy);
5281
 
 
5282
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":747
5283
 
 *             The returned message, or raises ZMQError otherwise.
5284
 
 *         """
5285
 
 *         self._check_closed()             # <<<<<<<<<<<<<<
5286
 
 *         if copy:
5287
 
 *             # This could be implemented by simple calling _recv_message and
5288
 
 */
5289
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5290
 
  __Pyx_GOTREF(__pyx_t_1);
5291
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5292
 
  __Pyx_GOTREF(__pyx_t_2);
5293
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5294
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5295
 
 
5296
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":748
5297
 
 *         """
5298
 
 *         self._check_closed()
5299
 
 *         if copy:             # <<<<<<<<<<<<<<
5300
 
 *             # This could be implemented by simple calling _recv_message and
5301
 
 *             # then casting to a str.
5302
 
 */
5303
 
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5304
 
  if (__pyx_t_3) {
5305
 
 
5306
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":751
5307
 
 *             # This could be implemented by simple calling _recv_message and
5308
 
 *             # then casting to a str.
5309
 
 *             return self._recv_copy(flags)             # <<<<<<<<<<<<<<
5310
 
 *         else:
5311
 
 *             return self._recv_message(flags)
5312
 
 */
5313
 
    __Pyx_XDECREF(__pyx_r);
5314
 
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___recv_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5315
 
    __Pyx_GOTREF(__pyx_t_2);
5316
 
    __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5317
 
    __Pyx_GOTREF(__pyx_t_1);
5318
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5319
 
    __Pyx_GOTREF(__pyx_t_4);
5320
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5321
 
    __Pyx_GIVEREF(__pyx_t_1);
5322
 
    __pyx_t_1 = 0;
5323
 
    __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5324
 
    __Pyx_GOTREF(__pyx_t_1);
5325
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5326
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5327
 
    __pyx_r = __pyx_t_1;
5328
 
    __pyx_t_1 = 0;
5329
 
    goto __pyx_L0;
5330
 
    goto __pyx_L6;
5331
 
  }
5332
 
  /*else*/ {
5333
 
 
5334
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":753
5335
 
 *             return self._recv_copy(flags)
5336
 
 *         else:
5337
 
 *             return self._recv_message(flags)             # <<<<<<<<<<<<<<
5338
 
 * 
5339
 
 *     def _recv_message(self, int flags=0):
5340
 
 */
5341
 
    __Pyx_XDECREF(__pyx_r);
5342
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___recv_message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5343
 
    __Pyx_GOTREF(__pyx_t_1);
5344
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5345
 
    __Pyx_GOTREF(__pyx_t_4);
5346
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5347
 
    __Pyx_GOTREF(__pyx_t_2);
5348
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
5349
 
    __Pyx_GIVEREF(__pyx_t_4);
5350
 
    __pyx_t_4 = 0;
5351
 
    __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5352
 
    __Pyx_GOTREF(__pyx_t_4);
5353
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5354
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5355
 
    __pyx_r = __pyx_t_4;
5356
 
    __pyx_t_4 = 0;
5357
 
    goto __pyx_L0;
5358
 
  }
5359
 
  __pyx_L6:;
5360
 
 
5361
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5362
 
  goto __pyx_L0;
5363
 
  __pyx_L1_error:;
5364
 
  __Pyx_XDECREF(__pyx_t_1);
5365
 
  __Pyx_XDECREF(__pyx_t_2);
5366
 
  __Pyx_XDECREF(__pyx_t_4);
5367
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv");
5368
 
  __pyx_r = NULL;
5369
 
  __pyx_L0:;
5370
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
5371
 
  __Pyx_DECREF(__pyx_v_copy);
5372
 
  __Pyx_XGIVEREF(__pyx_r);
5373
 
  __Pyx_RefNannyFinishContext();
5374
 
  return __pyx_r;
5375
 
}
5376
 
 
5377
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":755
5378
 
 *             return self._recv_message(flags)
5379
 
 * 
5380
 
 *     def _recv_message(self, int flags=0):             # <<<<<<<<<<<<<<
5381
 
 *         """Receive a message in a non-copying manner and return a Message."""
5382
 
 *         cdef int rc
5383
 
 */
5384
 
 
5385
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__recv_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5386
 
static char __pyx_doc_3zmq_4_zmq_6Socket__recv_message[] = "Receive a message in a non-copying manner and return a Message.";
5387
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__recv_message(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5388
 
  int __pyx_v_flags;
5389
 
  int __pyx_v_rc;
5390
 
  struct __pyx_obj_3zmq_4_zmq_Message *__pyx_v_msg;
5391
 
  PyObject *__pyx_r = NULL;
5392
 
  PyObject *__pyx_t_1 = NULL;
5393
 
  int __pyx_t_2;
5394
 
  PyObject *__pyx_t_3 = NULL;
5395
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flags,0};
5396
 
  __Pyx_RefNannySetupContext("_recv_message");
5397
 
  if (unlikely(__pyx_kwds)) {
5398
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5399
 
    PyObject* values[1] = {0};
5400
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5401
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5402
 
      case  0: break;
5403
 
      default: goto __pyx_L5_argtuple_error;
5404
 
    }
5405
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5406
 
      case  0:
5407
 
      if (kw_args > 1) {
5408
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
5409
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
5410
 
      }
5411
 
    }
5412
 
    if (unlikely(kw_args > 0)) {
5413
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_recv_message") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5414
 
    }
5415
 
    if (values[0]) {
5416
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5417
 
    } else {
5418
 
      __pyx_v_flags = ((int)0);
5419
 
    }
5420
 
  } else {
5421
 
    __pyx_v_flags = ((int)0);
5422
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5423
 
      case  1: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5424
 
      case  0: break;
5425
 
      default: goto __pyx_L5_argtuple_error;
5426
 
    }
5427
 
  }
5428
 
  goto __pyx_L4_argument_unpacking_done;
5429
 
  __pyx_L5_argtuple_error:;
5430
 
  __Pyx_RaiseArgtupleInvalid("_recv_message", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5431
 
  __pyx_L3_error:;
5432
 
  __Pyx_AddTraceback("zmq._zmq.Socket._recv_message");
5433
 
  return NULL;
5434
 
  __pyx_L4_argument_unpacking_done:;
5435
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
5436
 
  __pyx_v_msg = ((struct __pyx_obj_3zmq_4_zmq_Message *)Py_None); __Pyx_INCREF(Py_None);
5437
 
 
5438
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":759
5439
 
 *         cdef int rc
5440
 
 *         cdef Message msg
5441
 
 *         msg = Message()             # <<<<<<<<<<<<<<
5442
 
 * 
5443
 
 *         with nogil:
5444
 
 */
5445
 
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3zmq_4_zmq_Message)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5446
 
  __Pyx_GOTREF(__pyx_t_1);
5447
 
  __Pyx_DECREF(((PyObject *)__pyx_v_msg));
5448
 
  __pyx_v_msg = ((struct __pyx_obj_3zmq_4_zmq_Message *)__pyx_t_1);
5449
 
  __pyx_t_1 = 0;
5450
 
 
5451
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":761
5452
 
 *         msg = Message()
5453
 
 * 
5454
 
 *         with nogil:             # <<<<<<<<<<<<<<
5455
 
 *             rc = zmq_recv(self.handle, &msg.zmq_msg, flags)
5456
 
 * 
5457
 
 */
5458
 
  { PyThreadState *_save;
5459
 
    Py_UNBLOCK_THREADS
5460
 
    /*try:*/ {
5461
 
 
5462
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":762
5463
 
 * 
5464
 
 *         with nogil:
5465
 
 *             rc = zmq_recv(self.handle, &msg.zmq_msg, flags)             # <<<<<<<<<<<<<<
5466
 
 * 
5467
 
 *         if rc != 0:
5468
 
 */
5469
 
      __pyx_v_rc = zmq_recv(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, (&__pyx_v_msg->zmq_msg), __pyx_v_flags);
5470
 
    }
5471
 
    /*finally:*/ {
5472
 
 
5473
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":761
5474
 
 *         msg = Message()
5475
 
 * 
5476
 
 *         with nogil:             # <<<<<<<<<<<<<<
5477
 
 *             rc = zmq_recv(self.handle, &msg.zmq_msg, flags)
5478
 
 * 
5479
 
 */
5480
 
      Py_BLOCK_THREADS
5481
 
    }
5482
 
  }
5483
 
 
5484
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":764
5485
 
 *             rc = zmq_recv(self.handle, &msg.zmq_msg, flags)
5486
 
 * 
5487
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5488
 
 *             raise ZMQError()
5489
 
 *         return msg
5490
 
 */
5491
 
  __pyx_t_2 = (__pyx_v_rc != 0);
5492
 
  if (__pyx_t_2) {
5493
 
 
5494
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":765
5495
 
 * 
5496
 
 *         if rc != 0:
5497
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5498
 
 *         return msg
5499
 
 * 
5500
 
 */
5501
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5502
 
    __Pyx_GOTREF(__pyx_t_1);
5503
 
    __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5504
 
    __Pyx_GOTREF(__pyx_t_3);
5505
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5506
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
5507
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5508
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5509
 
    goto __pyx_L9;
5510
 
  }
5511
 
  __pyx_L9:;
5512
 
 
5513
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":766
5514
 
 *         if rc != 0:
5515
 
 *             raise ZMQError()
5516
 
 *         return msg             # <<<<<<<<<<<<<<
5517
 
 * 
5518
 
 *     def _recv_copy(self, int flags=0):
5519
 
 */
5520
 
  __Pyx_XDECREF(__pyx_r);
5521
 
  __Pyx_INCREF(((PyObject *)__pyx_v_msg));
5522
 
  __pyx_r = ((PyObject *)__pyx_v_msg);
5523
 
  goto __pyx_L0;
5524
 
 
5525
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5526
 
  goto __pyx_L0;
5527
 
  __pyx_L1_error:;
5528
 
  __Pyx_XDECREF(__pyx_t_1);
5529
 
  __Pyx_XDECREF(__pyx_t_3);
5530
 
  __Pyx_AddTraceback("zmq._zmq.Socket._recv_message");
5531
 
  __pyx_r = NULL;
5532
 
  __pyx_L0:;
5533
 
  __Pyx_DECREF((PyObject *)__pyx_v_msg);
5534
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
5535
 
  __Pyx_XGIVEREF(__pyx_r);
5536
 
  __Pyx_RefNannyFinishContext();
5537
 
  return __pyx_r;
5538
 
}
5539
 
 
5540
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":768
5541
 
 *         return msg
5542
 
 * 
5543
 
 *     def _recv_copy(self, int flags=0):             # <<<<<<<<<<<<<<
5544
 
 *         """Receive a message in a copying manner as a string."""
5545
 
 *         cdef int rc
5546
 
 */
5547
 
 
5548
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__recv_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5549
 
static char __pyx_doc_3zmq_4_zmq_6Socket__recv_copy[] = "Receive a message in a copying manner as a string.";
5550
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket__recv_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5551
 
  int __pyx_v_flags;
5552
 
  int __pyx_v_rc;
5553
 
  zmq_msg_t __pyx_v_data;
5554
 
  PyObject *__pyx_v_msg;
5555
 
  PyObject *__pyx_r = NULL;
5556
 
  int __pyx_t_1;
5557
 
  PyObject *__pyx_t_2 = NULL;
5558
 
  PyObject *__pyx_t_3 = NULL;
5559
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flags,0};
5560
 
  __Pyx_RefNannySetupContext("_recv_copy");
5561
 
  if (unlikely(__pyx_kwds)) {
5562
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5563
 
    PyObject* values[1] = {0};
5564
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5565
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5566
 
      case  0: break;
5567
 
      default: goto __pyx_L5_argtuple_error;
5568
 
    }
5569
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5570
 
      case  0:
5571
 
      if (kw_args > 1) {
5572
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
5573
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
5574
 
      }
5575
 
    }
5576
 
    if (unlikely(kw_args > 0)) {
5577
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_recv_copy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5578
 
    }
5579
 
    if (values[0]) {
5580
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5581
 
    } else {
5582
 
      __pyx_v_flags = ((int)0);
5583
 
    }
5584
 
  } else {
5585
 
    __pyx_v_flags = ((int)0);
5586
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5587
 
      case  1: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5588
 
      case  0: break;
5589
 
      default: goto __pyx_L5_argtuple_error;
5590
 
    }
5591
 
  }
5592
 
  goto __pyx_L4_argument_unpacking_done;
5593
 
  __pyx_L5_argtuple_error:;
5594
 
  __Pyx_RaiseArgtupleInvalid("_recv_copy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5595
 
  __pyx_L3_error:;
5596
 
  __Pyx_AddTraceback("zmq._zmq.Socket._recv_copy");
5597
 
  return NULL;
5598
 
  __pyx_L4_argument_unpacking_done:;
5599
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
5600
 
  __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
5601
 
 
5602
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":773
5603
 
 *         cdef zmq_msg_t data
5604
 
 * 
5605
 
 *         rc = zmq_msg_init(&data)             # <<<<<<<<<<<<<<
5606
 
 *         if rc != 0:
5607
 
 *             raise ZMQError()
5608
 
 */
5609
 
  __pyx_v_rc = zmq_msg_init((&__pyx_v_data));
5610
 
 
5611
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":774
5612
 
 * 
5613
 
 *         rc = zmq_msg_init(&data)
5614
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5615
 
 *             raise ZMQError()
5616
 
 * 
5617
 
 */
5618
 
  __pyx_t_1 = (__pyx_v_rc != 0);
5619
 
  if (__pyx_t_1) {
5620
 
 
5621
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":775
5622
 
 *         rc = zmq_msg_init(&data)
5623
 
 *         if rc != 0:
5624
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5625
 
 * 
5626
 
 *         with nogil:
5627
 
 */
5628
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5629
 
    __Pyx_GOTREF(__pyx_t_2);
5630
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5631
 
    __Pyx_GOTREF(__pyx_t_3);
5632
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5633
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
5634
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5635
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5636
 
    goto __pyx_L6;
5637
 
  }
5638
 
  __pyx_L6:;
5639
 
 
5640
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":777
5641
 
 *             raise ZMQError()
5642
 
 * 
5643
 
 *         with nogil:             # <<<<<<<<<<<<<<
5644
 
 *             rc = zmq_recv(self.handle, &data, flags)
5645
 
 * 
5646
 
 */
5647
 
  { PyThreadState *_save;
5648
 
    Py_UNBLOCK_THREADS
5649
 
    /*try:*/ {
5650
 
 
5651
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":778
5652
 
 * 
5653
 
 *         with nogil:
5654
 
 *             rc = zmq_recv(self.handle, &data, flags)             # <<<<<<<<<<<<<<
5655
 
 * 
5656
 
 *         if rc != 0:
5657
 
 */
5658
 
      __pyx_v_rc = zmq_recv(((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_self)->handle, (&__pyx_v_data), __pyx_v_flags);
5659
 
    }
5660
 
    /*finally:*/ {
5661
 
 
5662
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":777
5663
 
 *             raise ZMQError()
5664
 
 * 
5665
 
 *         with nogil:             # <<<<<<<<<<<<<<
5666
 
 *             rc = zmq_recv(self.handle, &data, flags)
5667
 
 * 
5668
 
 */
5669
 
      Py_BLOCK_THREADS
5670
 
    }
5671
 
  }
5672
 
 
5673
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":780
5674
 
 *             rc = zmq_recv(self.handle, &data, flags)
5675
 
 * 
5676
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5677
 
 *             raise ZMQError()
5678
 
 * 
5679
 
 */
5680
 
  __pyx_t_1 = (__pyx_v_rc != 0);
5681
 
  if (__pyx_t_1) {
5682
 
 
5683
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":781
5684
 
 * 
5685
 
 *         if rc != 0:
5686
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5687
 
 * 
5688
 
 *         try:
5689
 
 */
5690
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5691
 
    __Pyx_GOTREF(__pyx_t_3);
5692
 
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5693
 
    __Pyx_GOTREF(__pyx_t_2);
5694
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5695
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
5696
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5697
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5698
 
    goto __pyx_L10;
5699
 
  }
5700
 
  __pyx_L10:;
5701
 
 
5702
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":783
5703
 
 *             raise ZMQError()
5704
 
 * 
5705
 
 *         try:             # <<<<<<<<<<<<<<
5706
 
 *             msg = PyString_FromStringAndSize(
5707
 
 *                 <char *>zmq_msg_data(&data),
5708
 
 */
5709
 
  /*try:*/ {
5710
 
 
5711
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":786
5712
 
 *             msg = PyString_FromStringAndSize(
5713
 
 *                 <char *>zmq_msg_data(&data),
5714
 
 *                 zmq_msg_size(&data)             # <<<<<<<<<<<<<<
5715
 
 *             )
5716
 
 *         finally:
5717
 
 */
5718
 
    __pyx_t_2 = PyString_FromStringAndSize(((char *)zmq_msg_data((&__pyx_v_data))), zmq_msg_size((&__pyx_v_data))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L12;}
5719
 
    __Pyx_GOTREF(__pyx_t_2);
5720
 
    __Pyx_DECREF(__pyx_v_msg);
5721
 
    __pyx_v_msg = __pyx_t_2;
5722
 
    __pyx_t_2 = 0;
5723
 
  }
5724
 
  /*finally:*/ {
5725
 
    int __pyx_why;
5726
 
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
5727
 
    int __pyx_exc_lineno;
5728
 
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
5729
 
    __pyx_why = 0; goto __pyx_L13;
5730
 
    __pyx_L12: {
5731
 
      __pyx_why = 4;
5732
 
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5733
 
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5734
 
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
5735
 
      __pyx_exc_lineno = __pyx_lineno;
5736
 
      goto __pyx_L13;
5737
 
    }
5738
 
    __pyx_L13:;
5739
 
 
5740
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":789
5741
 
 *             )
5742
 
 *         finally:
5743
 
 *             rc = zmq_msg_close(&data)             # <<<<<<<<<<<<<<
5744
 
 * 
5745
 
 *         if rc != 0:
5746
 
 */
5747
 
    __pyx_v_rc = zmq_msg_close((&__pyx_v_data));
5748
 
    switch (__pyx_why) {
5749
 
      case 4: {
5750
 
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
5751
 
        __pyx_lineno = __pyx_exc_lineno;
5752
 
        __pyx_exc_type = 0;
5753
 
        __pyx_exc_value = 0;
5754
 
        __pyx_exc_tb = 0;
5755
 
        goto __pyx_L1_error;
5756
 
      }
5757
 
    }
5758
 
  }
5759
 
 
5760
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":791
5761
 
 *             rc = zmq_msg_close(&data)
5762
 
 * 
5763
 
 *         if rc != 0:             # <<<<<<<<<<<<<<
5764
 
 *             raise ZMQError()
5765
 
 *         return msg
5766
 
 */
5767
 
  __pyx_t_1 = (__pyx_v_rc != 0);
5768
 
  if (__pyx_t_1) {
5769
 
 
5770
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":792
5771
 
 * 
5772
 
 *         if rc != 0:
5773
 
 *             raise ZMQError()             # <<<<<<<<<<<<<<
5774
 
 *         return msg
5775
 
 * 
5776
 
 */
5777
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5778
 
    __Pyx_GOTREF(__pyx_t_2);
5779
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5780
 
    __Pyx_GOTREF(__pyx_t_3);
5781
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5782
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
5783
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5784
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5785
 
    goto __pyx_L15;
5786
 
  }
5787
 
  __pyx_L15:;
5788
 
 
5789
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":793
5790
 
 *         if rc != 0:
5791
 
 *             raise ZMQError()
5792
 
 *         return msg             # <<<<<<<<<<<<<<
5793
 
 * 
5794
 
 *     def send_multipart(self, msg_parts, int flags=0, copy=True):
5795
 
 */
5796
 
  __Pyx_XDECREF(__pyx_r);
5797
 
  __Pyx_INCREF(__pyx_v_msg);
5798
 
  __pyx_r = __pyx_v_msg;
5799
 
  goto __pyx_L0;
5800
 
 
5801
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5802
 
  goto __pyx_L0;
5803
 
  __pyx_L1_error:;
5804
 
  __Pyx_XDECREF(__pyx_t_2);
5805
 
  __Pyx_XDECREF(__pyx_t_3);
5806
 
  __Pyx_AddTraceback("zmq._zmq.Socket._recv_copy");
5807
 
  __pyx_r = NULL;
5808
 
  __pyx_L0:;
5809
 
  __Pyx_DECREF(__pyx_v_msg);
5810
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
5811
 
  __Pyx_XGIVEREF(__pyx_r);
5812
 
  __Pyx_RefNannyFinishContext();
5813
 
  return __pyx_r;
5814
 
}
5815
 
 
5816
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":795
5817
 
 *         return msg
5818
 
 * 
5819
 
 *     def send_multipart(self, msg_parts, int flags=0, copy=True):             # <<<<<<<<<<<<<<
5820
 
 *         """Send a sequence of messages as a multipart message.
5821
 
 * 
5822
 
 */
5823
 
 
5824
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send_multipart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5825
 
static char __pyx_doc_3zmq_4_zmq_6Socket_send_multipart[] = "Send a sequence of messages as a multipart message.\n\n        Parameters\n        ----------\n        msg_parts : iterable\n            A sequence of messages to send as a multipart message.\n        flags : int\n            Only the NOBLOCK flagis supported, SNDMORE is handled\n            automatically.\n        ";
5826
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send_multipart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5827
 
  PyObject *__pyx_v_msg_parts = 0;
5828
 
  int __pyx_v_flags;
5829
 
  PyObject *__pyx_v_copy = 0;
5830
 
  PyObject *__pyx_v_msg;
5831
 
  PyObject *__pyx_r = NULL;
5832
 
  Py_ssize_t __pyx_t_1;
5833
 
  PyObject *__pyx_t_2 = NULL;
5834
 
  PyObject *__pyx_t_3 = NULL;
5835
 
  PyObject *__pyx_t_4 = NULL;
5836
 
  PyObject *__pyx_t_5 = NULL;
5837
 
  PyObject *__pyx_t_6 = NULL;
5838
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__msg_parts,&__pyx_n_s__flags,&__pyx_n_s__copy,0};
5839
 
  __Pyx_RefNannySetupContext("send_multipart");
5840
 
  if (unlikely(__pyx_kwds)) {
5841
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5842
 
    PyObject* values[3] = {0,0,0};
5843
 
    values[2] = __pyx_k_7;
5844
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5845
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5846
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5847
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5848
 
      case  0: break;
5849
 
      default: goto __pyx_L5_argtuple_error;
5850
 
    }
5851
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5852
 
      case  0:
5853
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg_parts);
5854
 
      if (likely(values[0])) kw_args--;
5855
 
      else goto __pyx_L5_argtuple_error;
5856
 
      case  1:
5857
 
      if (kw_args > 1) {
5858
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
5859
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
5860
 
      }
5861
 
      case  2:
5862
 
      if (kw_args > 1) {
5863
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__copy);
5864
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
5865
 
      }
5866
 
    }
5867
 
    if (unlikely(kw_args > 0)) {
5868
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_multipart") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5869
 
    }
5870
 
    __pyx_v_msg_parts = values[0];
5871
 
    if (values[1]) {
5872
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5873
 
    } else {
5874
 
      __pyx_v_flags = ((int)0);
5875
 
    }
5876
 
    __pyx_v_copy = values[2];
5877
 
  } else {
5878
 
    __pyx_v_flags = ((int)0);
5879
 
    __pyx_v_copy = __pyx_k_7;
5880
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5881
 
      case  3: __pyx_v_copy = PyTuple_GET_ITEM(__pyx_args, 2);
5882
 
      case  2: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5883
 
      case  1: __pyx_v_msg_parts = PyTuple_GET_ITEM(__pyx_args, 0);
5884
 
      break;
5885
 
      default: goto __pyx_L5_argtuple_error;
5886
 
    }
5887
 
  }
5888
 
  goto __pyx_L4_argument_unpacking_done;
5889
 
  __pyx_L5_argtuple_error:;
5890
 
  __Pyx_RaiseArgtupleInvalid("send_multipart", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5891
 
  __pyx_L3_error:;
5892
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send_multipart");
5893
 
  return NULL;
5894
 
  __pyx_L4_argument_unpacking_done:;
5895
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
5896
 
  __Pyx_INCREF(__pyx_v_msg_parts);
5897
 
  __Pyx_INCREF(__pyx_v_copy);
5898
 
  __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
5899
 
 
5900
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":806
5901
 
 *             automatically.
5902
 
 *         """
5903
 
 *         for msg in msg_parts[:-1]:             # <<<<<<<<<<<<<<
5904
 
 *             self.send(msg, SNDMORE|flags, copy=copy)
5905
 
 *         # Send the last part without the SNDMORE flag.
5906
 
 */
5907
 
  __pyx_t_2 = PySequence_GetSlice(__pyx_v_msg_parts, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5908
 
  __Pyx_GOTREF(__pyx_t_2);
5909
 
  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
5910
 
    __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
5911
 
  } else {
5912
 
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5913
 
    __Pyx_GOTREF(__pyx_t_3);
5914
 
  }
5915
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5916
 
  for (;;) {
5917
 
    if (likely(PyList_CheckExact(__pyx_t_3))) {
5918
 
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
5919
 
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
5920
 
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
5921
 
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
5922
 
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
5923
 
    } else {
5924
 
      __pyx_t_2 = PyIter_Next(__pyx_t_3);
5925
 
      if (!__pyx_t_2) {
5926
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5927
 
        break;
5928
 
      }
5929
 
      __Pyx_GOTREF(__pyx_t_2);
5930
 
    }
5931
 
    __Pyx_DECREF(__pyx_v_msg);
5932
 
    __pyx_v_msg = __pyx_t_2;
5933
 
    __pyx_t_2 = 0;
5934
 
 
5935
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":807
5936
 
 *         """
5937
 
 *         for msg in msg_parts[:-1]:
5938
 
 *             self.send(msg, SNDMORE|flags, copy=copy)             # <<<<<<<<<<<<<<
5939
 
 *         # Send the last part without the SNDMORE flag.
5940
 
 *         self.send(msg_parts[-1], flags)
5941
 
 */
5942
 
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__send); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5943
 
    __Pyx_GOTREF(__pyx_t_2);
5944
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__SNDMORE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5945
 
    __Pyx_GOTREF(__pyx_t_4);
5946
 
    __pyx_t_5 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5947
 
    __Pyx_GOTREF(__pyx_t_5);
5948
 
    __pyx_t_6 = PyNumber_Or(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5949
 
    __Pyx_GOTREF(__pyx_t_6);
5950
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5951
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5952
 
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5953
 
    __Pyx_GOTREF(__pyx_t_5);
5954
 
    __Pyx_INCREF(__pyx_v_msg);
5955
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
5956
 
    __Pyx_GIVEREF(__pyx_v_msg);
5957
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5958
 
    __Pyx_GIVEREF(__pyx_t_6);
5959
 
    __pyx_t_6 = 0;
5960
 
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5961
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
5962
 
    if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__copy), __pyx_v_copy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5963
 
    __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5964
 
    __Pyx_GOTREF(__pyx_t_4);
5965
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5966
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5967
 
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
5968
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5969
 
  }
5970
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5971
 
 
5972
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":809
5973
 
 *             self.send(msg, SNDMORE|flags, copy=copy)
5974
 
 *         # Send the last part without the SNDMORE flag.
5975
 
 *         self.send(msg_parts[-1], flags)             # <<<<<<<<<<<<<<
5976
 
 * 
5977
 
 *     def recv_multipart(self, int flags=0, copy=True):
5978
 
 */
5979
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__send); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5980
 
  __Pyx_GOTREF(__pyx_t_3);
5981
 
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_msg_parts, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5982
 
  __Pyx_GOTREF(__pyx_t_4);
5983
 
  __pyx_t_6 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5984
 
  __Pyx_GOTREF(__pyx_t_6);
5985
 
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5986
 
  __Pyx_GOTREF(__pyx_t_5);
5987
 
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
5988
 
  __Pyx_GIVEREF(__pyx_t_4);
5989
 
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5990
 
  __Pyx_GIVEREF(__pyx_t_6);
5991
 
  __pyx_t_4 = 0;
5992
 
  __pyx_t_6 = 0;
5993
 
  __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5994
 
  __Pyx_GOTREF(__pyx_t_6);
5995
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5996
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5997
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5998
 
 
5999
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6000
 
  goto __pyx_L0;
6001
 
  __pyx_L1_error:;
6002
 
  __Pyx_XDECREF(__pyx_t_2);
6003
 
  __Pyx_XDECREF(__pyx_t_3);
6004
 
  __Pyx_XDECREF(__pyx_t_4);
6005
 
  __Pyx_XDECREF(__pyx_t_5);
6006
 
  __Pyx_XDECREF(__pyx_t_6);
6007
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send_multipart");
6008
 
  __pyx_r = NULL;
6009
 
  __pyx_L0:;
6010
 
  __Pyx_DECREF(__pyx_v_msg);
6011
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
6012
 
  __Pyx_DECREF(__pyx_v_msg_parts);
6013
 
  __Pyx_DECREF(__pyx_v_copy);
6014
 
  __Pyx_XGIVEREF(__pyx_r);
6015
 
  __Pyx_RefNannyFinishContext();
6016
 
  return __pyx_r;
6017
 
}
6018
 
 
6019
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":811
6020
 
 *         self.send(msg_parts[-1], flags)
6021
 
 * 
6022
 
 *     def recv_multipart(self, int flags=0, copy=True):             # <<<<<<<<<<<<<<
6023
 
 *         """Receive a multipart message as a list of messages.
6024
 
 * 
6025
 
 */
6026
 
 
6027
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv_multipart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6028
 
static char __pyx_doc_3zmq_4_zmq_6Socket_recv_multipart[] = "Receive a multipart message as a list of messages.\n\n        Parameters\n        ----------\n        flags : int\n            Any supported flag: NOBLOCK. If NOBLOCK is set, this method\n            will return None if a message is not ready. If NOBLOCK is not\n            set, then this method will block until a message arrives.\n\n        Returns\n        -------\n        msg_parts : list\n            A list of messages in the multipart message.\n        ";
6029
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv_multipart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6030
 
  int __pyx_v_flags;
6031
 
  PyObject *__pyx_v_copy = 0;
6032
 
  PyObject *__pyx_v_parts;
6033
 
  PyObject *__pyx_v_part;
6034
 
  PyObject *__pyx_r = NULL;
6035
 
  PyObject *__pyx_t_1 = NULL;
6036
 
  int __pyx_t_2;
6037
 
  PyObject *__pyx_t_3 = NULL;
6038
 
  PyObject *__pyx_t_4 = NULL;
6039
 
  PyObject *__pyx_t_5 = NULL;
6040
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flags,&__pyx_n_s__copy,0};
6041
 
  __Pyx_RefNannySetupContext("recv_multipart");
6042
 
  if (unlikely(__pyx_kwds)) {
6043
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6044
 
    PyObject* values[2] = {0,0};
6045
 
    values[1] = __pyx_k_8;
6046
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6047
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6048
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6049
 
      case  0: break;
6050
 
      default: goto __pyx_L5_argtuple_error;
6051
 
    }
6052
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6053
 
      case  0:
6054
 
      if (kw_args > 1) {
6055
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
6056
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
6057
 
      }
6058
 
      case  1:
6059
 
      if (kw_args > 1) {
6060
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__copy);
6061
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
6062
 
      }
6063
 
    }
6064
 
    if (unlikely(kw_args > 0)) {
6065
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "recv_multipart") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6066
 
    }
6067
 
    if (values[0]) {
6068
 
      __pyx_v_flags = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6069
 
    } else {
6070
 
      __pyx_v_flags = ((int)0);
6071
 
    }
6072
 
    __pyx_v_copy = values[1];
6073
 
  } else {
6074
 
    __pyx_v_flags = ((int)0);
6075
 
    __pyx_v_copy = __pyx_k_8;
6076
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6077
 
      case  2: __pyx_v_copy = PyTuple_GET_ITEM(__pyx_args, 1);
6078
 
      case  1: __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6079
 
      case  0: break;
6080
 
      default: goto __pyx_L5_argtuple_error;
6081
 
    }
6082
 
  }
6083
 
  goto __pyx_L4_argument_unpacking_done;
6084
 
  __pyx_L5_argtuple_error:;
6085
 
  __Pyx_RaiseArgtupleInvalid("recv_multipart", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6086
 
  __pyx_L3_error:;
6087
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv_multipart");
6088
 
  return NULL;
6089
 
  __pyx_L4_argument_unpacking_done:;
6090
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
6091
 
  __Pyx_INCREF(__pyx_v_copy);
6092
 
  __pyx_v_parts = Py_None; __Pyx_INCREF(Py_None);
6093
 
  __pyx_v_part = Py_None; __Pyx_INCREF(Py_None);
6094
 
 
6095
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":826
6096
 
 *             A list of messages in the multipart message.
6097
 
 *         """
6098
 
 *         parts = []             # <<<<<<<<<<<<<<
6099
 
 *         while True:
6100
 
 *             part = self.recv(flags, copy=copy)
6101
 
 */
6102
 
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6103
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6104
 
  __Pyx_DECREF(__pyx_v_parts);
6105
 
  __pyx_v_parts = ((PyObject *)__pyx_t_1);
6106
 
  __pyx_t_1 = 0;
6107
 
 
6108
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":827
6109
 
 *         """
6110
 
 *         parts = []
6111
 
 *         while True:             # <<<<<<<<<<<<<<
6112
 
 *             part = self.recv(flags, copy=copy)
6113
 
 *             parts.append(part)
6114
 
 */
6115
 
  while (1) {
6116
 
    __pyx_t_2 = 1;
6117
 
    if (!__pyx_t_2) break;
6118
 
 
6119
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":828
6120
 
 *         parts = []
6121
 
 *         while True:
6122
 
 *             part = self.recv(flags, copy=copy)             # <<<<<<<<<<<<<<
6123
 
 *             parts.append(part)
6124
 
 *             if self.rcvmore():
6125
 
 */
6126
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__recv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6127
 
    __Pyx_GOTREF(__pyx_t_1);
6128
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6129
 
    __Pyx_GOTREF(__pyx_t_3);
6130
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6131
 
    __Pyx_GOTREF(__pyx_t_4);
6132
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
6133
 
    __Pyx_GIVEREF(__pyx_t_3);
6134
 
    __pyx_t_3 = 0;
6135
 
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6136
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6137
 
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__copy), __pyx_v_copy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6138
 
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6139
 
    __Pyx_GOTREF(__pyx_t_5);
6140
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6141
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6142
 
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
6143
 
    __Pyx_DECREF(__pyx_v_part);
6144
 
    __pyx_v_part = __pyx_t_5;
6145
 
    __pyx_t_5 = 0;
6146
 
 
6147
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":829
6148
 
 *         while True:
6149
 
 *             part = self.recv(flags, copy=copy)
6150
 
 *             parts.append(part)             # <<<<<<<<<<<<<<
6151
 
 *             if self.rcvmore():
6152
 
 *                 continue
6153
 
 */
6154
 
    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_parts, __pyx_v_part); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6155
 
    __Pyx_GOTREF(__pyx_t_5);
6156
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6157
 
 
6158
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":830
6159
 
 *             part = self.recv(flags, copy=copy)
6160
 
 *             parts.append(part)
6161
 
 *             if self.rcvmore():             # <<<<<<<<<<<<<<
6162
 
 *                 continue
6163
 
 *             else:
6164
 
 */
6165
 
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__rcvmore); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6166
 
    __Pyx_GOTREF(__pyx_t_5);
6167
 
    __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6168
 
    __Pyx_GOTREF(__pyx_t_3);
6169
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6170
 
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6171
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6172
 
    if (__pyx_t_2) {
6173
 
 
6174
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":831
6175
 
 *             parts.append(part)
6176
 
 *             if self.rcvmore():
6177
 
 *                 continue             # <<<<<<<<<<<<<<
6178
 
 *             else:
6179
 
 *                 break
6180
 
 */
6181
 
      goto __pyx_L6_continue;
6182
 
      goto __pyx_L8;
6183
 
    }
6184
 
    /*else*/ {
6185
 
 
6186
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":833
6187
 
 *                 continue
6188
 
 *             else:
6189
 
 *                 break             # <<<<<<<<<<<<<<
6190
 
 *         return parts
6191
 
 * 
6192
 
 */
6193
 
      goto __pyx_L7_break;
6194
 
    }
6195
 
    __pyx_L8:;
6196
 
    __pyx_L6_continue:;
6197
 
  }
6198
 
  __pyx_L7_break:;
6199
 
 
6200
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":834
6201
 
 *             else:
6202
 
 *                 break
6203
 
 *         return parts             # <<<<<<<<<<<<<<
6204
 
 * 
6205
 
 *     def rcvmore(self):
6206
 
 */
6207
 
  __Pyx_XDECREF(__pyx_r);
6208
 
  __Pyx_INCREF(__pyx_v_parts);
6209
 
  __pyx_r = __pyx_v_parts;
6210
 
  goto __pyx_L0;
6211
 
 
6212
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6213
 
  goto __pyx_L0;
6214
 
  __pyx_L1_error:;
6215
 
  __Pyx_XDECREF(__pyx_t_1);
6216
 
  __Pyx_XDECREF(__pyx_t_3);
6217
 
  __Pyx_XDECREF(__pyx_t_4);
6218
 
  __Pyx_XDECREF(__pyx_t_5);
6219
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv_multipart");
6220
 
  __pyx_r = NULL;
6221
 
  __pyx_L0:;
6222
 
  __Pyx_DECREF(__pyx_v_parts);
6223
 
  __Pyx_DECREF(__pyx_v_part);
6224
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
6225
 
  __Pyx_DECREF(__pyx_v_copy);
6226
 
  __Pyx_XGIVEREF(__pyx_r);
6227
 
  __Pyx_RefNannyFinishContext();
6228
 
  return __pyx_r;
6229
 
}
6230
 
 
6231
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":836
6232
 
 *         return parts
6233
 
 * 
6234
 
 *     def rcvmore(self):             # <<<<<<<<<<<<<<
6235
 
 *         """Are there more parts to a multipart message."""
6236
 
 *         more = self.getsockopt(RCVMORE)
6237
 
 */
6238
 
 
6239
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_rcvmore(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
6240
 
static char __pyx_doc_3zmq_4_zmq_6Socket_rcvmore[] = "Are there more parts to a multipart message.";
6241
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_rcvmore(PyObject *__pyx_v_self, PyObject *unused) {
6242
 
  PyObject *__pyx_v_more;
6243
 
  PyObject *__pyx_r = NULL;
6244
 
  PyObject *__pyx_t_1 = NULL;
6245
 
  PyObject *__pyx_t_2 = NULL;
6246
 
  PyObject *__pyx_t_3 = NULL;
6247
 
  __Pyx_RefNannySetupContext("rcvmore");
6248
 
  __pyx_v_more = Py_None; __Pyx_INCREF(Py_None);
6249
 
 
6250
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":838
6251
 
 *     def rcvmore(self):
6252
 
 *         """Are there more parts to a multipart message."""
6253
 
 *         more = self.getsockopt(RCVMORE)             # <<<<<<<<<<<<<<
6254
 
 *         return bool(more)
6255
 
 * 
6256
 
 */
6257
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__getsockopt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6258
 
  __Pyx_GOTREF(__pyx_t_1);
6259
 
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__RCVMORE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6260
 
  __Pyx_GOTREF(__pyx_t_2);
6261
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6262
 
  __Pyx_GOTREF(__pyx_t_3);
6263
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
6264
 
  __Pyx_GIVEREF(__pyx_t_2);
6265
 
  __pyx_t_2 = 0;
6266
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6267
 
  __Pyx_GOTREF(__pyx_t_2);
6268
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6269
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6270
 
  __Pyx_DECREF(__pyx_v_more);
6271
 
  __pyx_v_more = __pyx_t_2;
6272
 
  __pyx_t_2 = 0;
6273
 
 
6274
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":839
6275
 
 *         """Are there more parts to a multipart message."""
6276
 
 *         more = self.getsockopt(RCVMORE)
6277
 
 *         return bool(more)             # <<<<<<<<<<<<<<
6278
 
 * 
6279
 
 *     def send_pyobj(self, obj, flags=0, protocol=-1):
6280
 
 */
6281
 
  __Pyx_XDECREF(__pyx_r);
6282
 
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6283
 
  __Pyx_GOTREF(__pyx_t_2);
6284
 
  __Pyx_INCREF(__pyx_v_more);
6285
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_more);
6286
 
  __Pyx_GIVEREF(__pyx_v_more);
6287
 
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyBool_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6288
 
  __Pyx_GOTREF(__pyx_t_3);
6289
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6290
 
  __pyx_r = __pyx_t_3;
6291
 
  __pyx_t_3 = 0;
6292
 
  goto __pyx_L0;
6293
 
 
6294
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6295
 
  goto __pyx_L0;
6296
 
  __pyx_L1_error:;
6297
 
  __Pyx_XDECREF(__pyx_t_1);
6298
 
  __Pyx_XDECREF(__pyx_t_2);
6299
 
  __Pyx_XDECREF(__pyx_t_3);
6300
 
  __Pyx_AddTraceback("zmq._zmq.Socket.rcvmore");
6301
 
  __pyx_r = NULL;
6302
 
  __pyx_L0:;
6303
 
  __Pyx_DECREF(__pyx_v_more);
6304
 
  __Pyx_XGIVEREF(__pyx_r);
6305
 
  __Pyx_RefNannyFinishContext();
6306
 
  return __pyx_r;
6307
 
}
6308
 
 
6309
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":841
6310
 
 *         return bool(more)
6311
 
 * 
6312
 
 *     def send_pyobj(self, obj, flags=0, protocol=-1):             # <<<<<<<<<<<<<<
6313
 
 *         """Send a Python object as a message using pickle to serialize.
6314
 
 * 
6315
 
 */
6316
 
 
6317
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send_pyobj(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6318
 
static char __pyx_doc_3zmq_4_zmq_6Socket_send_pyobj[] = "Send a Python object as a message using pickle to serialize.\n\n        Parameters\n        ----------\n        obj : Python object\n            The Python object to send.\n        flags : int\n            Any valid send flag.\n        protocol : int\n            The pickle protocol number to use. Default of -1 will select\n            the highest supported number. Use 0 for multiple platform\n            support.\n        ";
6319
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send_pyobj(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6320
 
  PyObject *__pyx_v_obj = 0;
6321
 
  PyObject *__pyx_v_flags = 0;
6322
 
  PyObject *__pyx_v_protocol = 0;
6323
 
  PyObject *__pyx_v_msg;
6324
 
  PyObject *__pyx_r = NULL;
6325
 
  PyObject *__pyx_t_1 = NULL;
6326
 
  PyObject *__pyx_t_2 = NULL;
6327
 
  PyObject *__pyx_t_3 = NULL;
6328
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__flags,&__pyx_n_s__protocol,0};
6329
 
  __Pyx_RefNannySetupContext("send_pyobj");
6330
 
  if (unlikely(__pyx_kwds)) {
6331
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6332
 
    PyObject* values[3] = {0,0,0};
6333
 
    values[1] = ((PyObject *)__pyx_int_0);
6334
 
    values[2] = ((PyObject *)__pyx_int_neg_1);
6335
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6336
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6337
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6338
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6339
 
      case  0: break;
6340
 
      default: goto __pyx_L5_argtuple_error;
6341
 
    }
6342
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6343
 
      case  0:
6344
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj);
6345
 
      if (likely(values[0])) kw_args--;
6346
 
      else goto __pyx_L5_argtuple_error;
6347
 
      case  1:
6348
 
      if (kw_args > 1) {
6349
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
6350
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
6351
 
      }
6352
 
      case  2:
6353
 
      if (kw_args > 1) {
6354
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__protocol);
6355
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
6356
 
      }
6357
 
    }
6358
 
    if (unlikely(kw_args > 0)) {
6359
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_pyobj") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6360
 
    }
6361
 
    __pyx_v_obj = values[0];
6362
 
    __pyx_v_flags = values[1];
6363
 
    __pyx_v_protocol = values[2];
6364
 
  } else {
6365
 
    __pyx_v_flags = ((PyObject *)__pyx_int_0);
6366
 
    __pyx_v_protocol = ((PyObject *)__pyx_int_neg_1);
6367
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6368
 
      case  3: __pyx_v_protocol = PyTuple_GET_ITEM(__pyx_args, 2);
6369
 
      case  2: __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 1);
6370
 
      case  1: __pyx_v_obj = PyTuple_GET_ITEM(__pyx_args, 0);
6371
 
      break;
6372
 
      default: goto __pyx_L5_argtuple_error;
6373
 
    }
6374
 
  }
6375
 
  goto __pyx_L4_argument_unpacking_done;
6376
 
  __pyx_L5_argtuple_error:;
6377
 
  __Pyx_RaiseArgtupleInvalid("send_pyobj", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6378
 
  __pyx_L3_error:;
6379
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send_pyobj");
6380
 
  return NULL;
6381
 
  __pyx_L4_argument_unpacking_done:;
6382
 
  __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
6383
 
 
6384
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":855
6385
 
 *             support.
6386
 
 *         """
6387
 
 *         msg = pickle.dumps(obj, protocol)             # <<<<<<<<<<<<<<
6388
 
 *         return self.send(msg, flags)
6389
 
 * 
6390
 
 */
6391
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pickle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6392
 
  __Pyx_GOTREF(__pyx_t_1);
6393
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dumps); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6394
 
  __Pyx_GOTREF(__pyx_t_2);
6395
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6396
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6397
 
  __Pyx_GOTREF(__pyx_t_1);
6398
 
  __Pyx_INCREF(__pyx_v_obj);
6399
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
6400
 
  __Pyx_GIVEREF(__pyx_v_obj);
6401
 
  __Pyx_INCREF(__pyx_v_protocol);
6402
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_protocol);
6403
 
  __Pyx_GIVEREF(__pyx_v_protocol);
6404
 
  __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6405
 
  __Pyx_GOTREF(__pyx_t_3);
6406
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6407
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6408
 
  __Pyx_DECREF(__pyx_v_msg);
6409
 
  __pyx_v_msg = __pyx_t_3;
6410
 
  __pyx_t_3 = 0;
6411
 
 
6412
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":856
6413
 
 *         """
6414
 
 *         msg = pickle.dumps(obj, protocol)
6415
 
 *         return self.send(msg, flags)             # <<<<<<<<<<<<<<
6416
 
 * 
6417
 
 *     def recv_pyobj(self, flags=0):
6418
 
 */
6419
 
  __Pyx_XDECREF(__pyx_r);
6420
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__send); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6421
 
  __Pyx_GOTREF(__pyx_t_3);
6422
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6423
 
  __Pyx_GOTREF(__pyx_t_1);
6424
 
  __Pyx_INCREF(__pyx_v_msg);
6425
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg);
6426
 
  __Pyx_GIVEREF(__pyx_v_msg);
6427
 
  __Pyx_INCREF(__pyx_v_flags);
6428
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_flags);
6429
 
  __Pyx_GIVEREF(__pyx_v_flags);
6430
 
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6431
 
  __Pyx_GOTREF(__pyx_t_2);
6432
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6433
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6434
 
  __pyx_r = __pyx_t_2;
6435
 
  __pyx_t_2 = 0;
6436
 
  goto __pyx_L0;
6437
 
 
6438
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6439
 
  goto __pyx_L0;
6440
 
  __pyx_L1_error:;
6441
 
  __Pyx_XDECREF(__pyx_t_1);
6442
 
  __Pyx_XDECREF(__pyx_t_2);
6443
 
  __Pyx_XDECREF(__pyx_t_3);
6444
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send_pyobj");
6445
 
  __pyx_r = NULL;
6446
 
  __pyx_L0:;
6447
 
  __Pyx_DECREF(__pyx_v_msg);
6448
 
  __Pyx_XGIVEREF(__pyx_r);
6449
 
  __Pyx_RefNannyFinishContext();
6450
 
  return __pyx_r;
6451
 
}
6452
 
 
6453
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":858
6454
 
 *         return self.send(msg, flags)
6455
 
 * 
6456
 
 *     def recv_pyobj(self, flags=0):             # <<<<<<<<<<<<<<
6457
 
 *         """Receive a Python object as a message using pickle to serialize.
6458
 
 * 
6459
 
 */
6460
 
 
6461
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv_pyobj(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6462
 
static char __pyx_doc_3zmq_4_zmq_6Socket_recv_pyobj[] = "Receive a Python object as a message using pickle to serialize.\n\n        Parameters\n        ----------\n        flags : int\n            Any valid recv flag.\n\n        Returns\n        -------\n        obj : Python object\n            The Python object that arrives as a message.\n        ";
6463
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv_pyobj(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6464
 
  PyObject *__pyx_v_flags = 0;
6465
 
  PyObject *__pyx_v_s;
6466
 
  PyObject *__pyx_r = NULL;
6467
 
  PyObject *__pyx_t_1 = NULL;
6468
 
  PyObject *__pyx_t_2 = NULL;
6469
 
  PyObject *__pyx_t_3 = NULL;
6470
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flags,0};
6471
 
  __Pyx_RefNannySetupContext("recv_pyobj");
6472
 
  if (unlikely(__pyx_kwds)) {
6473
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6474
 
    PyObject* values[1] = {0};
6475
 
    values[0] = ((PyObject *)__pyx_int_0);
6476
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6477
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6478
 
      case  0: break;
6479
 
      default: goto __pyx_L5_argtuple_error;
6480
 
    }
6481
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6482
 
      case  0:
6483
 
      if (kw_args > 1) {
6484
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
6485
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
6486
 
      }
6487
 
    }
6488
 
    if (unlikely(kw_args > 0)) {
6489
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "recv_pyobj") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6490
 
    }
6491
 
    __pyx_v_flags = values[0];
6492
 
  } else {
6493
 
    __pyx_v_flags = ((PyObject *)__pyx_int_0);
6494
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6495
 
      case  1: __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 0);
6496
 
      case  0: break;
6497
 
      default: goto __pyx_L5_argtuple_error;
6498
 
    }
6499
 
  }
6500
 
  goto __pyx_L4_argument_unpacking_done;
6501
 
  __pyx_L5_argtuple_error:;
6502
 
  __Pyx_RaiseArgtupleInvalid("recv_pyobj", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6503
 
  __pyx_L3_error:;
6504
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv_pyobj");
6505
 
  return NULL;
6506
 
  __pyx_L4_argument_unpacking_done:;
6507
 
  __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
6508
 
 
6509
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":871
6510
 
 *             The Python object that arrives as a message.
6511
 
 *         """
6512
 
 *         s = self.recv(flags)             # <<<<<<<<<<<<<<
6513
 
 *         return pickle.loads(s)
6514
 
 * 
6515
 
 */
6516
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__recv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6517
 
  __Pyx_GOTREF(__pyx_t_1);
6518
 
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6519
 
  __Pyx_GOTREF(__pyx_t_2);
6520
 
  __Pyx_INCREF(__pyx_v_flags);
6521
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_flags);
6522
 
  __Pyx_GIVEREF(__pyx_v_flags);
6523
 
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6524
 
  __Pyx_GOTREF(__pyx_t_3);
6525
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6526
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6527
 
  __Pyx_DECREF(__pyx_v_s);
6528
 
  __pyx_v_s = __pyx_t_3;
6529
 
  __pyx_t_3 = 0;
6530
 
 
6531
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":872
6532
 
 *         """
6533
 
 *         s = self.recv(flags)
6534
 
 *         return pickle.loads(s)             # <<<<<<<<<<<<<<
6535
 
 * 
6536
 
 *     def send_json(self, obj, flags=0):
6537
 
 */
6538
 
  __Pyx_XDECREF(__pyx_r);
6539
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pickle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6540
 
  __Pyx_GOTREF(__pyx_t_3);
6541
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__loads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6542
 
  __Pyx_GOTREF(__pyx_t_2);
6543
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6544
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6545
 
  __Pyx_GOTREF(__pyx_t_3);
6546
 
  __Pyx_INCREF(__pyx_v_s);
6547
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_s);
6548
 
  __Pyx_GIVEREF(__pyx_v_s);
6549
 
  __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6550
 
  __Pyx_GOTREF(__pyx_t_1);
6551
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6552
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6553
 
  __pyx_r = __pyx_t_1;
6554
 
  __pyx_t_1 = 0;
6555
 
  goto __pyx_L0;
6556
 
 
6557
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6558
 
  goto __pyx_L0;
6559
 
  __pyx_L1_error:;
6560
 
  __Pyx_XDECREF(__pyx_t_1);
6561
 
  __Pyx_XDECREF(__pyx_t_2);
6562
 
  __Pyx_XDECREF(__pyx_t_3);
6563
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv_pyobj");
6564
 
  __pyx_r = NULL;
6565
 
  __pyx_L0:;
6566
 
  __Pyx_DECREF(__pyx_v_s);
6567
 
  __Pyx_XGIVEREF(__pyx_r);
6568
 
  __Pyx_RefNannyFinishContext();
6569
 
  return __pyx_r;
6570
 
}
6571
 
 
6572
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":874
6573
 
 *         return pickle.loads(s)
6574
 
 * 
6575
 
 *     def send_json(self, obj, flags=0):             # <<<<<<<<<<<<<<
6576
 
 *         """Send a Python object as a message using json to serialize.
6577
 
 * 
6578
 
 */
6579
 
 
6580
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send_json(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6581
 
static char __pyx_doc_3zmq_4_zmq_6Socket_send_json[] = "Send a Python object as a message using json to serialize.\n\n        Parameters\n        ----------\n        obj : Python object\n            The Python object to send.\n        flags : int\n            Any valid send flag.\n        ";
6582
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_send_json(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6583
 
  PyObject *__pyx_v_obj = 0;
6584
 
  PyObject *__pyx_v_flags = 0;
6585
 
  PyObject *__pyx_v_msg;
6586
 
  PyObject *__pyx_r = NULL;
6587
 
  PyObject *__pyx_t_1 = NULL;
6588
 
  int __pyx_t_2;
6589
 
  PyObject *__pyx_t_3 = NULL;
6590
 
  PyObject *__pyx_t_4 = NULL;
6591
 
  PyObject *__pyx_t_5 = NULL;
6592
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__flags,0};
6593
 
  __Pyx_RefNannySetupContext("send_json");
6594
 
  if (unlikely(__pyx_kwds)) {
6595
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6596
 
    PyObject* values[2] = {0,0};
6597
 
    values[1] = ((PyObject *)__pyx_int_0);
6598
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6599
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6600
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6601
 
      case  0: break;
6602
 
      default: goto __pyx_L5_argtuple_error;
6603
 
    }
6604
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6605
 
      case  0:
6606
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj);
6607
 
      if (likely(values[0])) kw_args--;
6608
 
      else goto __pyx_L5_argtuple_error;
6609
 
      case  1:
6610
 
      if (kw_args > 1) {
6611
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
6612
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
6613
 
      }
6614
 
    }
6615
 
    if (unlikely(kw_args > 0)) {
6616
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_json") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6617
 
    }
6618
 
    __pyx_v_obj = values[0];
6619
 
    __pyx_v_flags = values[1];
6620
 
  } else {
6621
 
    __pyx_v_flags = ((PyObject *)__pyx_int_0);
6622
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6623
 
      case  2: __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 1);
6624
 
      case  1: __pyx_v_obj = PyTuple_GET_ITEM(__pyx_args, 0);
6625
 
      break;
6626
 
      default: goto __pyx_L5_argtuple_error;
6627
 
    }
6628
 
  }
6629
 
  goto __pyx_L4_argument_unpacking_done;
6630
 
  __pyx_L5_argtuple_error:;
6631
 
  __Pyx_RaiseArgtupleInvalid("send_json", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6632
 
  __pyx_L3_error:;
6633
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send_json");
6634
 
  return NULL;
6635
 
  __pyx_L4_argument_unpacking_done:;
6636
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
6637
 
  __Pyx_INCREF(__pyx_v_obj);
6638
 
  __Pyx_INCREF(__pyx_v_flags);
6639
 
  __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
6640
 
 
6641
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":884
6642
 
 *             Any valid send flag.
6643
 
 *         """
6644
 
 *         if json is None:             # <<<<<<<<<<<<<<
6645
 
 *             raise ImportError('json or simplejson library is required.')
6646
 
 *         else:
6647
 
 */
6648
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__json); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6649
 
  __Pyx_GOTREF(__pyx_t_1);
6650
 
  __pyx_t_2 = (__pyx_t_1 == Py_None);
6651
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6652
 
  if (__pyx_t_2) {
6653
 
 
6654
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":885
6655
 
 *         """
6656
 
 *         if json is None:
6657
 
 *             raise ImportError('json or simplejson library is required.')             # <<<<<<<<<<<<<<
6658
 
 *         else:
6659
 
 *             msg = json.dumps(obj, separators=(',',':'))
6660
 
 */
6661
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6662
 
    __Pyx_GOTREF(__pyx_t_1);
6663
 
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
6664
 
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_9));
6665
 
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
6666
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ImportError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6667
 
    __Pyx_GOTREF(__pyx_t_3);
6668
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6669
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
6670
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6671
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6672
 
    goto __pyx_L6;
6673
 
  }
6674
 
  /*else*/ {
6675
 
 
6676
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":887
6677
 
 *             raise ImportError('json or simplejson library is required.')
6678
 
 *         else:
6679
 
 *             msg = json.dumps(obj, separators=(',',':'))             # <<<<<<<<<<<<<<
6680
 
 *             return self.send(msg, flags)
6681
 
 * 
6682
 
 */
6683
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__json); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6684
 
    __Pyx_GOTREF(__pyx_t_3);
6685
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__dumps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6686
 
    __Pyx_GOTREF(__pyx_t_1);
6687
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6688
 
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6689
 
    __Pyx_GOTREF(__pyx_t_3);
6690
 
    __Pyx_INCREF(__pyx_v_obj);
6691
 
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_obj);
6692
 
    __Pyx_GIVEREF(__pyx_v_obj);
6693
 
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6694
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
6695
 
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6696
 
    __Pyx_GOTREF(__pyx_t_5);
6697
 
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
6698
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_10));
6699
 
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
6700
 
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
6701
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_kp_s_11));
6702
 
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
6703
 
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__separators), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6704
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6705
 
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6706
 
    __Pyx_GOTREF(__pyx_t_5);
6707
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6708
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6709
 
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
6710
 
    __Pyx_DECREF(__pyx_v_msg);
6711
 
    __pyx_v_msg = __pyx_t_5;
6712
 
    __pyx_t_5 = 0;
6713
 
 
6714
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":888
6715
 
 *         else:
6716
 
 *             msg = json.dumps(obj, separators=(',',':'))
6717
 
 *             return self.send(msg, flags)             # <<<<<<<<<<<<<<
6718
 
 * 
6719
 
 *     def recv_json(self, flags=0):
6720
 
 */
6721
 
    __Pyx_XDECREF(__pyx_r);
6722
 
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__send); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6723
 
    __Pyx_GOTREF(__pyx_t_5);
6724
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6725
 
    __Pyx_GOTREF(__pyx_t_4);
6726
 
    __Pyx_INCREF(__pyx_v_msg);
6727
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_msg);
6728
 
    __Pyx_GIVEREF(__pyx_v_msg);
6729
 
    __Pyx_INCREF(__pyx_v_flags);
6730
 
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_flags);
6731
 
    __Pyx_GIVEREF(__pyx_v_flags);
6732
 
    __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6733
 
    __Pyx_GOTREF(__pyx_t_3);
6734
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6735
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6736
 
    __pyx_r = __pyx_t_3;
6737
 
    __pyx_t_3 = 0;
6738
 
    goto __pyx_L0;
6739
 
  }
6740
 
  __pyx_L6:;
6741
 
 
6742
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6743
 
  goto __pyx_L0;
6744
 
  __pyx_L1_error:;
6745
 
  __Pyx_XDECREF(__pyx_t_1);
6746
 
  __Pyx_XDECREF(__pyx_t_3);
6747
 
  __Pyx_XDECREF(__pyx_t_4);
6748
 
  __Pyx_XDECREF(__pyx_t_5);
6749
 
  __Pyx_AddTraceback("zmq._zmq.Socket.send_json");
6750
 
  __pyx_r = NULL;
6751
 
  __pyx_L0:;
6752
 
  __Pyx_DECREF(__pyx_v_msg);
6753
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
6754
 
  __Pyx_DECREF(__pyx_v_obj);
6755
 
  __Pyx_DECREF(__pyx_v_flags);
6756
 
  __Pyx_XGIVEREF(__pyx_r);
6757
 
  __Pyx_RefNannyFinishContext();
6758
 
  return __pyx_r;
6759
 
}
6760
 
 
6761
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":890
6762
 
 *             return self.send(msg, flags)
6763
 
 * 
6764
 
 *     def recv_json(self, flags=0):             # <<<<<<<<<<<<<<
6765
 
 *         """Receive a Python object as a message using json to serialize.
6766
 
 * 
6767
 
 */
6768
 
 
6769
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv_json(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6770
 
static char __pyx_doc_3zmq_4_zmq_6Socket_recv_json[] = "Receive a Python object as a message using json to serialize.\n\n        Parameters\n        ----------\n        flags : int\n            Any valid recv flag.\n\n        Returns\n        -------\n        obj : Python object\n            The Python object that arrives as a message.\n        ";
6771
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Socket_recv_json(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6772
 
  PyObject *__pyx_v_flags = 0;
6773
 
  PyObject *__pyx_v_msg;
6774
 
  PyObject *__pyx_r = NULL;
6775
 
  PyObject *__pyx_t_1 = NULL;
6776
 
  int __pyx_t_2;
6777
 
  PyObject *__pyx_t_3 = NULL;
6778
 
  PyObject *__pyx_t_4 = NULL;
6779
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__flags,0};
6780
 
  __Pyx_RefNannySetupContext("recv_json");
6781
 
  if (unlikely(__pyx_kwds)) {
6782
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6783
 
    PyObject* values[1] = {0};
6784
 
    values[0] = ((PyObject *)__pyx_int_0);
6785
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6786
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6787
 
      case  0: break;
6788
 
      default: goto __pyx_L5_argtuple_error;
6789
 
    }
6790
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6791
 
      case  0:
6792
 
      if (kw_args > 1) {
6793
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
6794
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
6795
 
      }
6796
 
    }
6797
 
    if (unlikely(kw_args > 0)) {
6798
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "recv_json") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6799
 
    }
6800
 
    __pyx_v_flags = values[0];
6801
 
  } else {
6802
 
    __pyx_v_flags = ((PyObject *)__pyx_int_0);
6803
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6804
 
      case  1: __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 0);
6805
 
      case  0: break;
6806
 
      default: goto __pyx_L5_argtuple_error;
6807
 
    }
6808
 
  }
6809
 
  goto __pyx_L4_argument_unpacking_done;
6810
 
  __pyx_L5_argtuple_error:;
6811
 
  __Pyx_RaiseArgtupleInvalid("recv_json", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6812
 
  __pyx_L3_error:;
6813
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv_json");
6814
 
  return NULL;
6815
 
  __pyx_L4_argument_unpacking_done:;
6816
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
6817
 
  __Pyx_INCREF(__pyx_v_flags);
6818
 
  __pyx_v_msg = Py_None; __Pyx_INCREF(Py_None);
6819
 
 
6820
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":903
6821
 
 *             The Python object that arrives as a message.
6822
 
 *         """
6823
 
 *         if json is None:             # <<<<<<<<<<<<<<
6824
 
 *             raise ImportError('json or simplejson library is required.')
6825
 
 *         else:
6826
 
 */
6827
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__json); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6828
 
  __Pyx_GOTREF(__pyx_t_1);
6829
 
  __pyx_t_2 = (__pyx_t_1 == Py_None);
6830
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6831
 
  if (__pyx_t_2) {
6832
 
 
6833
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":904
6834
 
 *         """
6835
 
 *         if json is None:
6836
 
 *             raise ImportError('json or simplejson library is required.')             # <<<<<<<<<<<<<<
6837
 
 *         else:
6838
 
 *             msg = self.recv(flags)
6839
 
 */
6840
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6841
 
    __Pyx_GOTREF(__pyx_t_1);
6842
 
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
6843
 
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_9));
6844
 
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
6845
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ImportError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6846
 
    __Pyx_GOTREF(__pyx_t_3);
6847
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6848
 
    __Pyx_Raise(__pyx_t_3, 0, 0);
6849
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6850
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6851
 
    goto __pyx_L6;
6852
 
  }
6853
 
  /*else*/ {
6854
 
 
6855
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":906
6856
 
 *             raise ImportError('json or simplejson library is required.')
6857
 
 *         else:
6858
 
 *             msg = self.recv(flags)             # <<<<<<<<<<<<<<
6859
 
 *             return json.loads(msg)
6860
 
 * 
6861
 
 */
6862
 
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__recv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6863
 
    __Pyx_GOTREF(__pyx_t_3);
6864
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6865
 
    __Pyx_GOTREF(__pyx_t_1);
6866
 
    __Pyx_INCREF(__pyx_v_flags);
6867
 
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_flags);
6868
 
    __Pyx_GIVEREF(__pyx_v_flags);
6869
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6870
 
    __Pyx_GOTREF(__pyx_t_4);
6871
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6872
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6873
 
    __Pyx_DECREF(__pyx_v_msg);
6874
 
    __pyx_v_msg = __pyx_t_4;
6875
 
    __pyx_t_4 = 0;
6876
 
 
6877
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":907
6878
 
 *         else:
6879
 
 *             msg = self.recv(flags)
6880
 
 *             return json.loads(msg)             # <<<<<<<<<<<<<<
6881
 
 * 
6882
 
 * 
6883
 
 */
6884
 
    __Pyx_XDECREF(__pyx_r);
6885
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__json); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6886
 
    __Pyx_GOTREF(__pyx_t_4);
6887
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__loads); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6888
 
    __Pyx_GOTREF(__pyx_t_1);
6889
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6890
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6891
 
    __Pyx_GOTREF(__pyx_t_4);
6892
 
    __Pyx_INCREF(__pyx_v_msg);
6893
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_msg);
6894
 
    __Pyx_GIVEREF(__pyx_v_msg);
6895
 
    __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6896
 
    __Pyx_GOTREF(__pyx_t_3);
6897
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6898
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6899
 
    __pyx_r = __pyx_t_3;
6900
 
    __pyx_t_3 = 0;
6901
 
    goto __pyx_L0;
6902
 
  }
6903
 
  __pyx_L6:;
6904
 
 
6905
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6906
 
  goto __pyx_L0;
6907
 
  __pyx_L1_error:;
6908
 
  __Pyx_XDECREF(__pyx_t_1);
6909
 
  __Pyx_XDECREF(__pyx_t_3);
6910
 
  __Pyx_XDECREF(__pyx_t_4);
6911
 
  __Pyx_AddTraceback("zmq._zmq.Socket.recv_json");
6912
 
  __pyx_r = NULL;
6913
 
  __pyx_L0:;
6914
 
  __Pyx_DECREF(__pyx_v_msg);
6915
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
6916
 
  __Pyx_DECREF(__pyx_v_flags);
6917
 
  __Pyx_XGIVEREF(__pyx_r);
6918
 
  __Pyx_RefNannyFinishContext();
6919
 
  return __pyx_r;
6920
 
}
6921
 
 
6922
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":942
6923
 
 * 
6924
 
 * 
6925
 
 * def _poll(sockets, long timeout=-1):             # <<<<<<<<<<<<<<
6926
 
 *     """Poll a set of 0MQ sockets, native file descs. or sockets.
6927
 
 * 
6928
 
 */
6929
 
 
6930
 
static PyObject *__pyx_pf_3zmq_4_zmq__poll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6931
 
static char __pyx_doc_3zmq_4_zmq__poll[] = "Poll a set of 0MQ sockets, native file descs. or sockets.\n\n    Parameters\n    ----------\n    sockets : list of tuples of (socket, flags)\n        Each element of this list is a two-tuple containing a socket\n        and a flags. The socket may be a 0MQ socket or any object with\n        a :meth:`fileno` method. The flags can be zmq.POLLIN (for detecting\n        for incoming messages), zmq.POLLOUT (for detecting that send is OK)\n        or zmq.POLLIN|zmq.POLLOUT for detecting both.\n    timeout : int\n        The number of microseconds to poll for. Negative means no timeout.\n    ";
6932
 
static PyObject *__pyx_pf_3zmq_4_zmq__poll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6933
 
  PyObject *__pyx_v_sockets = 0;
6934
 
  long __pyx_v_timeout;
6935
 
  int __pyx_v_rc;
6936
 
  int __pyx_v_i;
6937
 
  zmq_pollitem_t *__pyx_v_pollitems;
6938
 
  int __pyx_v_nsockets;
6939
 
  struct __pyx_obj_3zmq_4_zmq_Socket *__pyx_v_current_socket;
6940
 
  PyObject *__pyx_v_pollitems_o;
6941
 
  PyObject *__pyx_v_s;
6942
 
  PyObject *__pyx_v_events;
6943
 
  PyObject *__pyx_v_fileno;
6944
 
  PyObject *__pyx_v_results;
6945
 
  PyObject *__pyx_v_revents;
6946
 
  PyObject *__pyx_r = NULL;
6947
 
  Py_ssize_t __pyx_t_1;
6948
 
  PyObject *__pyx_t_2 = NULL;
6949
 
  int __pyx_t_3;
6950
 
  int __pyx_t_4;
6951
 
  PyObject *__pyx_t_5 = NULL;
6952
 
  int __pyx_t_6;
6953
 
  short __pyx_t_7;
6954
 
  int __pyx_t_8;
6955
 
  PyObject *__pyx_t_9 = NULL;
6956
 
  PyObject *__pyx_t_10 = NULL;
6957
 
  PyObject *__pyx_t_11 = NULL;
6958
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sockets,&__pyx_n_s__timeout,0};
6959
 
  __Pyx_RefNannySetupContext("_poll");
6960
 
  __pyx_self = __pyx_self;
6961
 
  if (unlikely(__pyx_kwds)) {
6962
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
6963
 
    PyObject* values[2] = {0,0};
6964
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6965
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6966
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6967
 
      case  0: break;
6968
 
      default: goto __pyx_L5_argtuple_error;
6969
 
    }
6970
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6971
 
      case  0:
6972
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sockets);
6973
 
      if (likely(values[0])) kw_args--;
6974
 
      else goto __pyx_L5_argtuple_error;
6975
 
      case  1:
6976
 
      if (kw_args > 0) {
6977
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
6978
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
6979
 
      }
6980
 
    }
6981
 
    if (unlikely(kw_args > 0)) {
6982
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_poll") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6983
 
    }
6984
 
    __pyx_v_sockets = values[0];
6985
 
    if (values[1]) {
6986
 
      __pyx_v_timeout = __Pyx_PyInt_AsLong(values[1]); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6987
 
    } else {
6988
 
      __pyx_v_timeout = ((long)-1);
6989
 
    }
6990
 
  } else {
6991
 
    __pyx_v_timeout = ((long)-1);
6992
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
6993
 
      case  2: __pyx_v_timeout = __Pyx_PyInt_AsLong(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_timeout == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6994
 
      case  1: __pyx_v_sockets = PyTuple_GET_ITEM(__pyx_args, 0);
6995
 
      break;
6996
 
      default: goto __pyx_L5_argtuple_error;
6997
 
    }
6998
 
  }
6999
 
  goto __pyx_L4_argument_unpacking_done;
7000
 
  __pyx_L5_argtuple_error:;
7001
 
  __Pyx_RaiseArgtupleInvalid("_poll", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7002
 
  __pyx_L3_error:;
7003
 
  __Pyx_AddTraceback("zmq._zmq._poll");
7004
 
  return NULL;
7005
 
  __pyx_L4_argument_unpacking_done:;
7006
 
  __Pyx_INCREF(__pyx_v_sockets);
7007
 
  __pyx_v_current_socket = ((struct __pyx_obj_3zmq_4_zmq_Socket *)Py_None); __Pyx_INCREF(Py_None);
7008
 
  __pyx_v_pollitems_o = Py_None; __Pyx_INCREF(Py_None);
7009
 
  __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
7010
 
  __pyx_v_events = Py_None; __Pyx_INCREF(Py_None);
7011
 
  __pyx_v_fileno = Py_None; __Pyx_INCREF(Py_None);
7012
 
  __pyx_v_results = Py_None; __Pyx_INCREF(Py_None);
7013
 
  __pyx_v_revents = Py_None; __Pyx_INCREF(Py_None);
7014
 
 
7015
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":957
7016
 
 *     """
7017
 
 *     cdef int rc, i
7018
 
 *     cdef zmq_pollitem_t *pollitems = NULL             # <<<<<<<<<<<<<<
7019
 
 *     cdef int nsockets = len(sockets)
7020
 
 *     cdef Socket current_socket
7021
 
 */
7022
 
  __pyx_v_pollitems = NULL;
7023
 
 
7024
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":958
7025
 
 *     cdef int rc, i
7026
 
 *     cdef zmq_pollitem_t *pollitems = NULL
7027
 
 *     cdef int nsockets = len(sockets)             # <<<<<<<<<<<<<<
7028
 
 *     cdef Socket current_socket
7029
 
 *     pollitems_o = allocate(nsockets*sizeof(zmq_pollitem_t),<void**>&pollitems)
7030
 
 */
7031
 
  __pyx_t_1 = PyObject_Length(__pyx_v_sockets); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7032
 
  __pyx_v_nsockets = __pyx_t_1;
7033
 
 
7034
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":960
7035
 
 *     cdef int nsockets = len(sockets)
7036
 
 *     cdef Socket current_socket
7037
 
 *     pollitems_o = allocate(nsockets*sizeof(zmq_pollitem_t),<void**>&pollitems)             # <<<<<<<<<<<<<<
7038
 
 * 
7039
 
 *     for i in range(nsockets):
7040
 
 */
7041
 
  __pyx_t_2 = __pyx_f_3zmq_4_zmq_allocate((__pyx_v_nsockets * (sizeof(zmq_pollitem_t))), ((void **)(&__pyx_v_pollitems))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7042
 
  __Pyx_GOTREF(__pyx_t_2);
7043
 
  __Pyx_DECREF(__pyx_v_pollitems_o);
7044
 
  __pyx_v_pollitems_o = __pyx_t_2;
7045
 
  __pyx_t_2 = 0;
7046
 
 
7047
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":962
7048
 
 *     pollitems_o = allocate(nsockets*sizeof(zmq_pollitem_t),<void**>&pollitems)
7049
 
 * 
7050
 
 *     for i in range(nsockets):             # <<<<<<<<<<<<<<
7051
 
 *         s = sockets[i][0]
7052
 
 *         events = sockets[i][1]
7053
 
 */
7054
 
  __pyx_t_3 = __pyx_v_nsockets;
7055
 
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7056
 
    __pyx_v_i = __pyx_t_4;
7057
 
 
7058
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":963
7059
 
 * 
7060
 
 *     for i in range(nsockets):
7061
 
 *         s = sockets[i][0]             # <<<<<<<<<<<<<<
7062
 
 *         events = sockets[i][1]
7063
 
 *         if isinstance(s, Socket):
7064
 
 */
7065
 
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sockets, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7066
 
    __Pyx_GOTREF(__pyx_t_2);
7067
 
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7068
 
    __Pyx_GOTREF(__pyx_t_5);
7069
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7070
 
    __Pyx_DECREF(__pyx_v_s);
7071
 
    __pyx_v_s = __pyx_t_5;
7072
 
    __pyx_t_5 = 0;
7073
 
 
7074
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":964
7075
 
 *     for i in range(nsockets):
7076
 
 *         s = sockets[i][0]
7077
 
 *         events = sockets[i][1]             # <<<<<<<<<<<<<<
7078
 
 *         if isinstance(s, Socket):
7079
 
 *             current_socket = s
7080
 
 */
7081
 
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_sockets, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7082
 
    __Pyx_GOTREF(__pyx_t_5);
7083
 
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7084
 
    __Pyx_GOTREF(__pyx_t_2);
7085
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7086
 
    __Pyx_DECREF(__pyx_v_events);
7087
 
    __pyx_v_events = __pyx_t_2;
7088
 
    __pyx_t_2 = 0;
7089
 
 
7090
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":965
7091
 
 *         s = sockets[i][0]
7092
 
 *         events = sockets[i][1]
7093
 
 *         if isinstance(s, Socket):             # <<<<<<<<<<<<<<
7094
 
 *             current_socket = s
7095
 
 *             pollitems[i].socket = current_socket.handle
7096
 
 */
7097
 
    __pyx_t_6 = PyObject_TypeCheck(__pyx_v_s, ((PyTypeObject *)((PyObject*)__pyx_ptype_3zmq_4_zmq_Socket))); 
7098
 
    if (__pyx_t_6) {
7099
 
 
7100
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":966
7101
 
 *         events = sockets[i][1]
7102
 
 *         if isinstance(s, Socket):
7103
 
 *             current_socket = s             # <<<<<<<<<<<<<<
7104
 
 *             pollitems[i].socket = current_socket.handle
7105
 
 *             pollitems[i].events = events
7106
 
 */
7107
 
      if (!(likely(((__pyx_v_s) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_s, __pyx_ptype_3zmq_4_zmq_Socket))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7108
 
      __Pyx_INCREF(__pyx_v_s);
7109
 
      __Pyx_DECREF(((PyObject *)__pyx_v_current_socket));
7110
 
      __pyx_v_current_socket = ((struct __pyx_obj_3zmq_4_zmq_Socket *)__pyx_v_s);
7111
 
 
7112
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":967
7113
 
 *         if isinstance(s, Socket):
7114
 
 *             current_socket = s
7115
 
 *             pollitems[i].socket = current_socket.handle             # <<<<<<<<<<<<<<
7116
 
 *             pollitems[i].events = events
7117
 
 *             pollitems[i].revents = 0
7118
 
 */
7119
 
      (__pyx_v_pollitems[__pyx_v_i]).socket = __pyx_v_current_socket->handle;
7120
 
 
7121
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":968
7122
 
 *             current_socket = s
7123
 
 *             pollitems[i].socket = current_socket.handle
7124
 
 *             pollitems[i].events = events             # <<<<<<<<<<<<<<
7125
 
 *             pollitems[i].revents = 0
7126
 
 *         elif isinstance(s, int):
7127
 
 */
7128
 
      __pyx_t_7 = __Pyx_PyInt_AsShort(__pyx_v_events); if (unlikely((__pyx_t_7 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7129
 
      (__pyx_v_pollitems[__pyx_v_i]).events = __pyx_t_7;
7130
 
 
7131
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":969
7132
 
 *             pollitems[i].socket = current_socket.handle
7133
 
 *             pollitems[i].events = events
7134
 
 *             pollitems[i].revents = 0             # <<<<<<<<<<<<<<
7135
 
 *         elif isinstance(s, int):
7136
 
 *             pollitems[i].socket = NULL
7137
 
 */
7138
 
      (__pyx_v_pollitems[__pyx_v_i]).revents = 0;
7139
 
      goto __pyx_L8;
7140
 
    }
7141
 
 
7142
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":970
7143
 
 *             pollitems[i].events = events
7144
 
 *             pollitems[i].revents = 0
7145
 
 *         elif isinstance(s, int):             # <<<<<<<<<<<<<<
7146
 
 *             pollitems[i].socket = NULL
7147
 
 *             pollitems[i].fd = s
7148
 
 */
7149
 
    __pyx_t_6 = PyObject_TypeCheck(__pyx_v_s, ((PyTypeObject *)((PyObject*)&PyInt_Type))); 
7150
 
    if (__pyx_t_6) {
7151
 
 
7152
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":971
7153
 
 *             pollitems[i].revents = 0
7154
 
 *         elif isinstance(s, int):
7155
 
 *             pollitems[i].socket = NULL             # <<<<<<<<<<<<<<
7156
 
 *             pollitems[i].fd = s
7157
 
 *             pollitems[i].events = events
7158
 
 */
7159
 
      (__pyx_v_pollitems[__pyx_v_i]).socket = NULL;
7160
 
 
7161
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":972
7162
 
 *         elif isinstance(s, int):
7163
 
 *             pollitems[i].socket = NULL
7164
 
 *             pollitems[i].fd = s             # <<<<<<<<<<<<<<
7165
 
 *             pollitems[i].events = events
7166
 
 *             pollitems[i].revents = 0
7167
 
 */
7168
 
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_v_s); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7169
 
      (__pyx_v_pollitems[__pyx_v_i]).fd = __pyx_t_8;
7170
 
 
7171
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":973
7172
 
 *             pollitems[i].socket = NULL
7173
 
 *             pollitems[i].fd = s
7174
 
 *             pollitems[i].events = events             # <<<<<<<<<<<<<<
7175
 
 *             pollitems[i].revents = 0
7176
 
 *         elif hasattr(s, 'fileno'):
7177
 
 */
7178
 
      __pyx_t_7 = __Pyx_PyInt_AsShort(__pyx_v_events); if (unlikely((__pyx_t_7 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7179
 
      (__pyx_v_pollitems[__pyx_v_i]).events = __pyx_t_7;
7180
 
 
7181
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":974
7182
 
 *             pollitems[i].fd = s
7183
 
 *             pollitems[i].events = events
7184
 
 *             pollitems[i].revents = 0             # <<<<<<<<<<<<<<
7185
 
 *         elif hasattr(s, 'fileno'):
7186
 
 *             try:
7187
 
 */
7188
 
      (__pyx_v_pollitems[__pyx_v_i]).revents = 0;
7189
 
      goto __pyx_L8;
7190
 
    }
7191
 
 
7192
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":975
7193
 
 *             pollitems[i].events = events
7194
 
 *             pollitems[i].revents = 0
7195
 
 *         elif hasattr(s, 'fileno'):             # <<<<<<<<<<<<<<
7196
 
 *             try:
7197
 
 *                 fileno = int(s.fileno())
7198
 
 */
7199
 
    __pyx_t_6 = PyObject_HasAttr(__pyx_v_s, ((PyObject *)__pyx_n_s__fileno)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7200
 
    if (__pyx_t_6) {
7201
 
 
7202
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":976
7203
 
 *             pollitems[i].revents = 0
7204
 
 *         elif hasattr(s, 'fileno'):
7205
 
 *             try:             # <<<<<<<<<<<<<<
7206
 
 *                 fileno = int(s.fileno())
7207
 
 *             except:
7208
 
 */
7209
 
      {
7210
 
        PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
7211
 
        __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
7212
 
        __Pyx_XGOTREF(__pyx_save_exc_type);
7213
 
        __Pyx_XGOTREF(__pyx_save_exc_value);
7214
 
        __Pyx_XGOTREF(__pyx_save_exc_tb);
7215
 
        /*try:*/ {
7216
 
 
7217
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":977
7218
 
 *         elif hasattr(s, 'fileno'):
7219
 
 *             try:
7220
 
 *                 fileno = int(s.fileno())             # <<<<<<<<<<<<<<
7221
 
 *             except:
7222
 
 *                 raise ValueError('fileno() must return an valid integer fd')
7223
 
 */
7224
 
          __pyx_t_2 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__fileno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
7225
 
          __Pyx_GOTREF(__pyx_t_2);
7226
 
          __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
7227
 
          __Pyx_GOTREF(__pyx_t_5);
7228
 
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7229
 
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
7230
 
          __Pyx_GOTREF(__pyx_t_2);
7231
 
          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
7232
 
          __Pyx_GIVEREF(__pyx_t_5);
7233
 
          __pyx_t_5 = 0;
7234
 
          __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
7235
 
          __Pyx_GOTREF(__pyx_t_5);
7236
 
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7237
 
          __Pyx_DECREF(__pyx_v_fileno);
7238
 
          __pyx_v_fileno = __pyx_t_5;
7239
 
          __pyx_t_5 = 0;
7240
 
        }
7241
 
        /*else:*/ {
7242
 
 
7243
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":981
7244
 
 *                 raise ValueError('fileno() must return an valid integer fd')
7245
 
 *             else:
7246
 
 *                 pollitems[i].socket = NULL             # <<<<<<<<<<<<<<
7247
 
 *                 pollitems[i].fd = fileno
7248
 
 *                 pollitems[i].events = events
7249
 
 */
7250
 
          (__pyx_v_pollitems[__pyx_v_i]).socket = NULL;
7251
 
 
7252
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":982
7253
 
 *             else:
7254
 
 *                 pollitems[i].socket = NULL
7255
 
 *                 pollitems[i].fd = fileno             # <<<<<<<<<<<<<<
7256
 
 *                 pollitems[i].events = events
7257
 
 *                 pollitems[i].revents = 0
7258
 
 */
7259
 
          __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_v_fileno); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
7260
 
          (__pyx_v_pollitems[__pyx_v_i]).fd = __pyx_t_8;
7261
 
 
7262
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":983
7263
 
 *                 pollitems[i].socket = NULL
7264
 
 *                 pollitems[i].fd = fileno
7265
 
 *                 pollitems[i].events = events             # <<<<<<<<<<<<<<
7266
 
 *                 pollitems[i].revents = 0
7267
 
 *         else:
7268
 
 */
7269
 
          __pyx_t_7 = __Pyx_PyInt_AsShort(__pyx_v_events); if (unlikely((__pyx_t_7 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
7270
 
          (__pyx_v_pollitems[__pyx_v_i]).events = __pyx_t_7;
7271
 
 
7272
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":984
7273
 
 *                 pollitems[i].fd = fileno
7274
 
 *                 pollitems[i].events = events
7275
 
 *                 pollitems[i].revents = 0             # <<<<<<<<<<<<<<
7276
 
 *         else:
7277
 
 *             raise TypeError(
7278
 
 */
7279
 
          (__pyx_v_pollitems[__pyx_v_i]).revents = 0;
7280
 
        }
7281
 
        __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
7282
 
        __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
7283
 
        __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
7284
 
        goto __pyx_L16_try_end;
7285
 
        __pyx_L9_error:;
7286
 
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7287
 
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7288
 
 
7289
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":978
7290
 
 *             try:
7291
 
 *                 fileno = int(s.fileno())
7292
 
 *             except:             # <<<<<<<<<<<<<<
7293
 
 *                 raise ValueError('fileno() must return an valid integer fd')
7294
 
 *             else:
7295
 
 */
7296
 
        /*except:*/ {
7297
 
          __Pyx_AddTraceback("zmq._zmq._poll");
7298
 
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
7299
 
          __Pyx_GOTREF(__pyx_t_5);
7300
 
          __Pyx_GOTREF(__pyx_t_2);
7301
 
          __Pyx_GOTREF(__pyx_t_9);
7302
 
 
7303
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":979
7304
 
 *                 fileno = int(s.fileno())
7305
 
 *             except:
7306
 
 *                 raise ValueError('fileno() must return an valid integer fd')             # <<<<<<<<<<<<<<
7307
 
 *             else:
7308
 
 *                 pollitems[i].socket = NULL
7309
 
 */
7310
 
          __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
7311
 
          __Pyx_GOTREF(__pyx_t_10);
7312
 
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
7313
 
          PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_kp_s_12));
7314
 
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
7315
 
          __pyx_t_11 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
7316
 
          __Pyx_GOTREF(__pyx_t_11);
7317
 
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7318
 
          __Pyx_Raise(__pyx_t_11, 0, 0);
7319
 
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7320
 
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
7321
 
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7322
 
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7323
 
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7324
 
          goto __pyx_L10_exception_handled;
7325
 
        }
7326
 
        __pyx_L11_except_error:;
7327
 
        __Pyx_XGIVEREF(__pyx_save_exc_type);
7328
 
        __Pyx_XGIVEREF(__pyx_save_exc_value);
7329
 
        __Pyx_XGIVEREF(__pyx_save_exc_tb);
7330
 
        __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
7331
 
        goto __pyx_L1_error;
7332
 
        __pyx_L10_exception_handled:;
7333
 
        __Pyx_XGIVEREF(__pyx_save_exc_type);
7334
 
        __Pyx_XGIVEREF(__pyx_save_exc_value);
7335
 
        __Pyx_XGIVEREF(__pyx_save_exc_tb);
7336
 
        __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
7337
 
        __pyx_L16_try_end:;
7338
 
      }
7339
 
      goto __pyx_L8;
7340
 
    }
7341
 
    /*else*/ {
7342
 
 
7343
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":989
7344
 
 *                 "Socket must be a 0MQ socket, an integer fd or have "
7345
 
 *                 "a fileno() method: %r" % s
7346
 
 *             )             # <<<<<<<<<<<<<<
7347
 
 * 
7348
 
 *     # int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout)
7349
 
 */
7350
 
      __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_v_s); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7351
 
      __Pyx_GOTREF(__pyx_t_9);
7352
 
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7353
 
      __Pyx_GOTREF(__pyx_t_2);
7354
 
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9);
7355
 
      __Pyx_GIVEREF(__pyx_t_9);
7356
 
      __pyx_t_9 = 0;
7357
 
      __pyx_t_9 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7358
 
      __Pyx_GOTREF(__pyx_t_9);
7359
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7360
 
      __Pyx_Raise(__pyx_t_9, 0, 0);
7361
 
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7362
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7363
 
    }
7364
 
    __pyx_L8:;
7365
 
  }
7366
 
 
7367
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":992
7368
 
 * 
7369
 
 *     # int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout)
7370
 
 *     with nogil:             # <<<<<<<<<<<<<<
7371
 
 *         rc = zmq_poll(pollitems, nsockets, timeout)
7372
 
 *     if rc == -1:
7373
 
 */
7374
 
  { PyThreadState *_save;
7375
 
    Py_UNBLOCK_THREADS
7376
 
    /*try:*/ {
7377
 
 
7378
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":993
7379
 
 *     # int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout)
7380
 
 *     with nogil:
7381
 
 *         rc = zmq_poll(pollitems, nsockets, timeout)             # <<<<<<<<<<<<<<
7382
 
 *     if rc == -1:
7383
 
 *         raise ZMQError()
7384
 
 */
7385
 
      __pyx_v_rc = zmq_poll(__pyx_v_pollitems, __pyx_v_nsockets, __pyx_v_timeout);
7386
 
    }
7387
 
    /*finally:*/ {
7388
 
 
7389
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":992
7390
 
 * 
7391
 
 *     # int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout)
7392
 
 *     with nogil:             # <<<<<<<<<<<<<<
7393
 
 *         rc = zmq_poll(pollitems, nsockets, timeout)
7394
 
 *     if rc == -1:
7395
 
 */
7396
 
      Py_BLOCK_THREADS
7397
 
    }
7398
 
  }
7399
 
 
7400
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":994
7401
 
 *     with nogil:
7402
 
 *         rc = zmq_poll(pollitems, nsockets, timeout)
7403
 
 *     if rc == -1:             # <<<<<<<<<<<<<<
7404
 
 *         raise ZMQError()
7405
 
 * 
7406
 
 */
7407
 
  __pyx_t_6 = (__pyx_v_rc == -1);
7408
 
  if (__pyx_t_6) {
7409
 
 
7410
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":995
7411
 
 *         rc = zmq_poll(pollitems, nsockets, timeout)
7412
 
 *     if rc == -1:
7413
 
 *         raise ZMQError()             # <<<<<<<<<<<<<<
7414
 
 * 
7415
 
 *     results = []
7416
 
 */
7417
 
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQError); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7418
 
    __Pyx_GOTREF(__pyx_t_9);
7419
 
    __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7420
 
    __Pyx_GOTREF(__pyx_t_2);
7421
 
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7422
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
7423
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7424
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7425
 
    goto __pyx_L22;
7426
 
  }
7427
 
  __pyx_L22:;
7428
 
 
7429
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":997
7430
 
 *         raise ZMQError()
7431
 
 * 
7432
 
 *     results = []             # <<<<<<<<<<<<<<
7433
 
 *     for i in range(nsockets):
7434
 
 *         s = sockets[i][0]
7435
 
 */
7436
 
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7437
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
7438
 
  __Pyx_DECREF(__pyx_v_results);
7439
 
  __pyx_v_results = ((PyObject *)__pyx_t_2);
7440
 
  __pyx_t_2 = 0;
7441
 
 
7442
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":998
7443
 
 * 
7444
 
 *     results = []
7445
 
 *     for i in range(nsockets):             # <<<<<<<<<<<<<<
7446
 
 *         s = sockets[i][0]
7447
 
 *         # Return the fd for sockets, for compat. with select.poll.
7448
 
 */
7449
 
  __pyx_t_3 = __pyx_v_nsockets;
7450
 
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7451
 
    __pyx_v_i = __pyx_t_4;
7452
 
 
7453
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":999
7454
 
 *     results = []
7455
 
 *     for i in range(nsockets):
7456
 
 *         s = sockets[i][0]             # <<<<<<<<<<<<<<
7457
 
 *         # Return the fd for sockets, for compat. with select.poll.
7458
 
 *         if hasattr(s, 'fileno'):
7459
 
 */
7460
 
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sockets, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7461
 
    __Pyx_GOTREF(__pyx_t_2);
7462
 
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7463
 
    __Pyx_GOTREF(__pyx_t_9);
7464
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7465
 
    __Pyx_DECREF(__pyx_v_s);
7466
 
    __pyx_v_s = __pyx_t_9;
7467
 
    __pyx_t_9 = 0;
7468
 
 
7469
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1001
7470
 
 *         s = sockets[i][0]
7471
 
 *         # Return the fd for sockets, for compat. with select.poll.
7472
 
 *         if hasattr(s, 'fileno'):             # <<<<<<<<<<<<<<
7473
 
 *             s = s.fileno()
7474
 
 *         revents = pollitems[i].revents
7475
 
 */
7476
 
    __pyx_t_6 = PyObject_HasAttr(__pyx_v_s, ((PyObject *)__pyx_n_s__fileno)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7477
 
    if (__pyx_t_6) {
7478
 
 
7479
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1002
7480
 
 *         # Return the fd for sockets, for compat. with select.poll.
7481
 
 *         if hasattr(s, 'fileno'):
7482
 
 *             s = s.fileno()             # <<<<<<<<<<<<<<
7483
 
 *         revents = pollitems[i].revents
7484
 
 *         # Only return sockets with non-zero status for compat. with select.poll.
7485
 
 */
7486
 
      __pyx_t_9 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__fileno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7487
 
      __Pyx_GOTREF(__pyx_t_9);
7488
 
      __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7489
 
      __Pyx_GOTREF(__pyx_t_2);
7490
 
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7491
 
      __Pyx_DECREF(__pyx_v_s);
7492
 
      __pyx_v_s = __pyx_t_2;
7493
 
      __pyx_t_2 = 0;
7494
 
      goto __pyx_L25;
7495
 
    }
7496
 
    __pyx_L25:;
7497
 
 
7498
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1003
7499
 
 *         if hasattr(s, 'fileno'):
7500
 
 *             s = s.fileno()
7501
 
 *         revents = pollitems[i].revents             # <<<<<<<<<<<<<<
7502
 
 *         # Only return sockets with non-zero status for compat. with select.poll.
7503
 
 *         if revents > 0:
7504
 
 */
7505
 
    __pyx_t_2 = PyInt_FromLong((__pyx_v_pollitems[__pyx_v_i]).revents); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7506
 
    __Pyx_GOTREF(__pyx_t_2);
7507
 
    __Pyx_DECREF(__pyx_v_revents);
7508
 
    __pyx_v_revents = __pyx_t_2;
7509
 
    __pyx_t_2 = 0;
7510
 
 
7511
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1005
7512
 
 *         revents = pollitems[i].revents
7513
 
 *         # Only return sockets with non-zero status for compat. with select.poll.
7514
 
 *         if revents > 0:             # <<<<<<<<<<<<<<
7515
 
 *             results.append((s, revents))
7516
 
 * 
7517
 
 */
7518
 
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_revents, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7519
 
    __Pyx_GOTREF(__pyx_t_2);
7520
 
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7521
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7522
 
    if (__pyx_t_6) {
7523
 
 
7524
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1006
7525
 
 *         # Only return sockets with non-zero status for compat. with select.poll.
7526
 
 *         if revents > 0:
7527
 
 *             results.append((s, revents))             # <<<<<<<<<<<<<<
7528
 
 * 
7529
 
 *     return results
7530
 
 */
7531
 
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7532
 
      __Pyx_GOTREF(__pyx_t_2);
7533
 
      __Pyx_INCREF(__pyx_v_s);
7534
 
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
7535
 
      __Pyx_GIVEREF(__pyx_v_s);
7536
 
      __Pyx_INCREF(__pyx_v_revents);
7537
 
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_revents);
7538
 
      __Pyx_GIVEREF(__pyx_v_revents);
7539
 
      __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_results, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7540
 
      __Pyx_GOTREF(__pyx_t_9);
7541
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7542
 
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7543
 
      goto __pyx_L26;
7544
 
    }
7545
 
    __pyx_L26:;
7546
 
  }
7547
 
 
7548
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1008
7549
 
 *             results.append((s, revents))
7550
 
 * 
7551
 
 *     return results             # <<<<<<<<<<<<<<
7552
 
 * 
7553
 
 * 
7554
 
 */
7555
 
  __Pyx_XDECREF(__pyx_r);
7556
 
  __Pyx_INCREF(__pyx_v_results);
7557
 
  __pyx_r = __pyx_v_results;
7558
 
  goto __pyx_L0;
7559
 
 
7560
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7561
 
  goto __pyx_L0;
7562
 
  __pyx_L1_error:;
7563
 
  __Pyx_XDECREF(__pyx_t_2);
7564
 
  __Pyx_XDECREF(__pyx_t_5);
7565
 
  __Pyx_XDECREF(__pyx_t_9);
7566
 
  __Pyx_XDECREF(__pyx_t_10);
7567
 
  __Pyx_XDECREF(__pyx_t_11);
7568
 
  __Pyx_AddTraceback("zmq._zmq._poll");
7569
 
  __pyx_r = NULL;
7570
 
  __pyx_L0:;
7571
 
  __Pyx_DECREF((PyObject *)__pyx_v_current_socket);
7572
 
  __Pyx_DECREF(__pyx_v_pollitems_o);
7573
 
  __Pyx_DECREF(__pyx_v_s);
7574
 
  __Pyx_DECREF(__pyx_v_events);
7575
 
  __Pyx_DECREF(__pyx_v_fileno);
7576
 
  __Pyx_DECREF(__pyx_v_results);
7577
 
  __Pyx_DECREF(__pyx_v_revents);
7578
 
  __Pyx_DECREF(__pyx_v_sockets);
7579
 
  __Pyx_XGIVEREF(__pyx_r);
7580
 
  __Pyx_RefNannyFinishContext();
7581
 
  return __pyx_r;
7582
 
}
7583
 
 
7584
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1014
7585
 
 *     """An stateful poll interface that mirrors Python's built-in poll."""
7586
 
 * 
7587
 
 *     def __init__(self):             # <<<<<<<<<<<<<<
7588
 
 *         self.sockets = {}
7589
 
 * 
7590
 
 */
7591
 
 
7592
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller___init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
7593
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_6Poller___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Poller___init__, METH_O, __Pyx_DOCSTR(0)};
7594
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller___init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
7595
 
  PyObject *__pyx_r = NULL;
7596
 
  PyObject *__pyx_t_1 = NULL;
7597
 
  __Pyx_RefNannySetupContext("__init__");
7598
 
  __pyx_self = __pyx_self;
7599
 
 
7600
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1015
7601
 
 * 
7602
 
 *     def __init__(self):
7603
 
 *         self.sockets = {}             # <<<<<<<<<<<<<<
7604
 
 * 
7605
 
 *     def register(self, socket, flags=POLLIN|POLLOUT):
7606
 
 */
7607
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7608
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
7609
 
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__sockets, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7610
 
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
7611
 
 
7612
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7613
 
  goto __pyx_L0;
7614
 
  __pyx_L1_error:;
7615
 
  __Pyx_XDECREF(__pyx_t_1);
7616
 
  __Pyx_AddTraceback("zmq._zmq.Poller.__init__");
7617
 
  __pyx_r = NULL;
7618
 
  __pyx_L0:;
7619
 
  __Pyx_XGIVEREF(__pyx_r);
7620
 
  __Pyx_RefNannyFinishContext();
7621
 
  return __pyx_r;
7622
 
}
7623
 
 
7624
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1017
7625
 
 *         self.sockets = {}
7626
 
 * 
7627
 
 *     def register(self, socket, flags=POLLIN|POLLOUT):             # <<<<<<<<<<<<<<
7628
 
 *         """Register a 0MQ socket or native fd for I/O monitoring.
7629
 
 * 
7630
 
 */
7631
 
 
7632
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_register(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7633
 
static char __pyx_doc_3zmq_4_zmq_6Poller_register[] = "Register a 0MQ socket or native fd for I/O monitoring.\n\n        Parameters\n        ----------\n        socket : zmq.Socket or native socket\n            A zmq.Socket or any Python object having a :meth:`fileno` \n            method that returns a valid file descriptor.\n        flags : int\n            The events to watch for.  Can be POLLIN, POLLOUT or POLLIN|POLLOUT.\n        ";
7634
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_6Poller_register = {__Pyx_NAMESTR("register"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Poller_register, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Poller_register)};
7635
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_register(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7636
 
  PyObject *__pyx_v_self = 0;
7637
 
  PyObject *__pyx_v_socket = 0;
7638
 
  PyObject *__pyx_v_flags = 0;
7639
 
  PyObject *__pyx_r = NULL;
7640
 
  PyObject *__pyx_t_1 = NULL;
7641
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__socket,&__pyx_n_s__flags,0};
7642
 
  __Pyx_RefNannySetupContext("register");
7643
 
  __pyx_self = __pyx_self;
7644
 
  if (unlikely(__pyx_kwds)) {
7645
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7646
 
    PyObject* values[3] = {0,0,0};
7647
 
    values[2] = __pyx_k_14;
7648
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7649
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7650
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7651
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7652
 
      case  0: break;
7653
 
      default: goto __pyx_L5_argtuple_error;
7654
 
    }
7655
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7656
 
      case  0:
7657
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7658
 
      if (likely(values[0])) kw_args--;
7659
 
      else goto __pyx_L5_argtuple_error;
7660
 
      case  1:
7661
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__socket);
7662
 
      if (likely(values[1])) kw_args--;
7663
 
      else {
7664
 
        __Pyx_RaiseArgtupleInvalid("register", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7665
 
      }
7666
 
      case  2:
7667
 
      if (kw_args > 0) {
7668
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
7669
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
7670
 
      }
7671
 
    }
7672
 
    if (unlikely(kw_args > 0)) {
7673
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "register") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7674
 
    }
7675
 
    __pyx_v_self = values[0];
7676
 
    __pyx_v_socket = values[1];
7677
 
    __pyx_v_flags = values[2];
7678
 
  } else {
7679
 
    __pyx_v_flags = __pyx_k_14;
7680
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7681
 
      case  3:
7682
 
      __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 2);
7683
 
      case  2:
7684
 
      __pyx_v_socket = PyTuple_GET_ITEM(__pyx_args, 1);
7685
 
      __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7686
 
      break;
7687
 
      default: goto __pyx_L5_argtuple_error;
7688
 
    }
7689
 
  }
7690
 
  goto __pyx_L4_argument_unpacking_done;
7691
 
  __pyx_L5_argtuple_error:;
7692
 
  __Pyx_RaiseArgtupleInvalid("register", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7693
 
  __pyx_L3_error:;
7694
 
  __Pyx_AddTraceback("zmq._zmq.Poller.register");
7695
 
  return NULL;
7696
 
  __pyx_L4_argument_unpacking_done:;
7697
 
 
7698
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1028
7699
 
 *             The events to watch for.  Can be POLLIN, POLLOUT or POLLIN|POLLOUT.
7700
 
 *         """
7701
 
 *         self.sockets[socket] = flags             # <<<<<<<<<<<<<<
7702
 
 * 
7703
 
 *     def modify(self, socket, flags=POLLIN|POLLOUT):
7704
 
 */
7705
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__sockets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7706
 
  __Pyx_GOTREF(__pyx_t_1);
7707
 
  if (PyObject_SetItem(__pyx_t_1, __pyx_v_socket, __pyx_v_flags) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7708
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7709
 
 
7710
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7711
 
  goto __pyx_L0;
7712
 
  __pyx_L1_error:;
7713
 
  __Pyx_XDECREF(__pyx_t_1);
7714
 
  __Pyx_AddTraceback("zmq._zmq.Poller.register");
7715
 
  __pyx_r = NULL;
7716
 
  __pyx_L0:;
7717
 
  __Pyx_XGIVEREF(__pyx_r);
7718
 
  __Pyx_RefNannyFinishContext();
7719
 
  return __pyx_r;
7720
 
}
7721
 
 
7722
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1030
7723
 
 *         self.sockets[socket] = flags
7724
 
 * 
7725
 
 *     def modify(self, socket, flags=POLLIN|POLLOUT):             # <<<<<<<<<<<<<<
7726
 
 *         """Modify the flags for an already registered 0MQ socket or native fd."""
7727
 
 *         self.register(socket, flags)
7728
 
 */
7729
 
 
7730
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_modify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7731
 
static char __pyx_doc_3zmq_4_zmq_6Poller_modify[] = "Modify the flags for an already registered 0MQ socket or native fd.";
7732
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_6Poller_modify = {__Pyx_NAMESTR("modify"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Poller_modify, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Poller_modify)};
7733
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_modify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7734
 
  PyObject *__pyx_v_self = 0;
7735
 
  PyObject *__pyx_v_socket = 0;
7736
 
  PyObject *__pyx_v_flags = 0;
7737
 
  PyObject *__pyx_r = NULL;
7738
 
  PyObject *__pyx_t_1 = NULL;
7739
 
  PyObject *__pyx_t_2 = NULL;
7740
 
  PyObject *__pyx_t_3 = NULL;
7741
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__socket,&__pyx_n_s__flags,0};
7742
 
  __Pyx_RefNannySetupContext("modify");
7743
 
  __pyx_self = __pyx_self;
7744
 
  if (unlikely(__pyx_kwds)) {
7745
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7746
 
    PyObject* values[3] = {0,0,0};
7747
 
    values[2] = __pyx_k_15;
7748
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7749
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7750
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7751
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7752
 
      case  0: break;
7753
 
      default: goto __pyx_L5_argtuple_error;
7754
 
    }
7755
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7756
 
      case  0:
7757
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7758
 
      if (likely(values[0])) kw_args--;
7759
 
      else goto __pyx_L5_argtuple_error;
7760
 
      case  1:
7761
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__socket);
7762
 
      if (likely(values[1])) kw_args--;
7763
 
      else {
7764
 
        __Pyx_RaiseArgtupleInvalid("modify", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7765
 
      }
7766
 
      case  2:
7767
 
      if (kw_args > 0) {
7768
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags);
7769
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
7770
 
      }
7771
 
    }
7772
 
    if (unlikely(kw_args > 0)) {
7773
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "modify") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7774
 
    }
7775
 
    __pyx_v_self = values[0];
7776
 
    __pyx_v_socket = values[1];
7777
 
    __pyx_v_flags = values[2];
7778
 
  } else {
7779
 
    __pyx_v_flags = __pyx_k_15;
7780
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7781
 
      case  3:
7782
 
      __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 2);
7783
 
      case  2:
7784
 
      __pyx_v_socket = PyTuple_GET_ITEM(__pyx_args, 1);
7785
 
      __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7786
 
      break;
7787
 
      default: goto __pyx_L5_argtuple_error;
7788
 
    }
7789
 
  }
7790
 
  goto __pyx_L4_argument_unpacking_done;
7791
 
  __pyx_L5_argtuple_error:;
7792
 
  __Pyx_RaiseArgtupleInvalid("modify", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7793
 
  __pyx_L3_error:;
7794
 
  __Pyx_AddTraceback("zmq._zmq.Poller.modify");
7795
 
  return NULL;
7796
 
  __pyx_L4_argument_unpacking_done:;
7797
 
 
7798
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1032
7799
 
 *     def modify(self, socket, flags=POLLIN|POLLOUT):
7800
 
 *         """Modify the flags for an already registered 0MQ socket or native fd."""
7801
 
 *         self.register(socket, flags)             # <<<<<<<<<<<<<<
7802
 
 * 
7803
 
 *     def unregister(self, socket):
7804
 
 */
7805
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__register); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7806
 
  __Pyx_GOTREF(__pyx_t_1);
7807
 
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7808
 
  __Pyx_GOTREF(__pyx_t_2);
7809
 
  __Pyx_INCREF(__pyx_v_socket);
7810
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_socket);
7811
 
  __Pyx_GIVEREF(__pyx_v_socket);
7812
 
  __Pyx_INCREF(__pyx_v_flags);
7813
 
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_flags);
7814
 
  __Pyx_GIVEREF(__pyx_v_flags);
7815
 
  __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7816
 
  __Pyx_GOTREF(__pyx_t_3);
7817
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7818
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7819
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7820
 
 
7821
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7822
 
  goto __pyx_L0;
7823
 
  __pyx_L1_error:;
7824
 
  __Pyx_XDECREF(__pyx_t_1);
7825
 
  __Pyx_XDECREF(__pyx_t_2);
7826
 
  __Pyx_XDECREF(__pyx_t_3);
7827
 
  __Pyx_AddTraceback("zmq._zmq.Poller.modify");
7828
 
  __pyx_r = NULL;
7829
 
  __pyx_L0:;
7830
 
  __Pyx_XGIVEREF(__pyx_r);
7831
 
  __Pyx_RefNannyFinishContext();
7832
 
  return __pyx_r;
7833
 
}
7834
 
 
7835
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1034
7836
 
 *         self.register(socket, flags)
7837
 
 * 
7838
 
 *     def unregister(self, socket):             # <<<<<<<<<<<<<<
7839
 
 *         """Remove a 0MQ socket or native fd for I/O monitoring.
7840
 
 * 
7841
 
 */
7842
 
 
7843
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_unregister(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7844
 
static char __pyx_doc_3zmq_4_zmq_6Poller_unregister[] = "Remove a 0MQ socket or native fd for I/O monitoring.\n\n        Parameters\n        ----------\n        socket : Socket\n            The socket instance to stop polling.\n        ";
7845
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_6Poller_unregister = {__Pyx_NAMESTR("unregister"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Poller_unregister, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Poller_unregister)};
7846
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_unregister(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7847
 
  PyObject *__pyx_v_self = 0;
7848
 
  PyObject *__pyx_v_socket = 0;
7849
 
  PyObject *__pyx_r = NULL;
7850
 
  PyObject *__pyx_t_1 = NULL;
7851
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__socket,0};
7852
 
  __Pyx_RefNannySetupContext("unregister");
7853
 
  __pyx_self = __pyx_self;
7854
 
  if (unlikely(__pyx_kwds)) {
7855
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7856
 
    PyObject* values[2] = {0,0};
7857
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7858
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7859
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7860
 
      case  0: break;
7861
 
      default: goto __pyx_L5_argtuple_error;
7862
 
    }
7863
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7864
 
      case  0:
7865
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7866
 
      if (likely(values[0])) kw_args--;
7867
 
      else goto __pyx_L5_argtuple_error;
7868
 
      case  1:
7869
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__socket);
7870
 
      if (likely(values[1])) kw_args--;
7871
 
      else {
7872
 
        __Pyx_RaiseArgtupleInvalid("unregister", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7873
 
      }
7874
 
    }
7875
 
    if (unlikely(kw_args > 0)) {
7876
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "unregister") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7877
 
    }
7878
 
    __pyx_v_self = values[0];
7879
 
    __pyx_v_socket = values[1];
7880
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
7881
 
    goto __pyx_L5_argtuple_error;
7882
 
  } else {
7883
 
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7884
 
    __pyx_v_socket = PyTuple_GET_ITEM(__pyx_args, 1);
7885
 
  }
7886
 
  goto __pyx_L4_argument_unpacking_done;
7887
 
  __pyx_L5_argtuple_error:;
7888
 
  __Pyx_RaiseArgtupleInvalid("unregister", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7889
 
  __pyx_L3_error:;
7890
 
  __Pyx_AddTraceback("zmq._zmq.Poller.unregister");
7891
 
  return NULL;
7892
 
  __pyx_L4_argument_unpacking_done:;
7893
 
 
7894
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1042
7895
 
 *             The socket instance to stop polling.
7896
 
 *         """
7897
 
 *         del self.sockets[socket]             # <<<<<<<<<<<<<<
7898
 
 * 
7899
 
 *     def poll(self, timeout=None):
7900
 
 */
7901
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__sockets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7902
 
  __Pyx_GOTREF(__pyx_t_1);
7903
 
  if (PyObject_DelItem(__pyx_t_1, __pyx_v_socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7904
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7905
 
 
7906
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7907
 
  goto __pyx_L0;
7908
 
  __pyx_L1_error:;
7909
 
  __Pyx_XDECREF(__pyx_t_1);
7910
 
  __Pyx_AddTraceback("zmq._zmq.Poller.unregister");
7911
 
  __pyx_r = NULL;
7912
 
  __pyx_L0:;
7913
 
  __Pyx_XGIVEREF(__pyx_r);
7914
 
  __Pyx_RefNannyFinishContext();
7915
 
  return __pyx_r;
7916
 
}
7917
 
 
7918
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1044
7919
 
 *         del self.sockets[socket]
7920
 
 * 
7921
 
 *     def poll(self, timeout=None):             # <<<<<<<<<<<<<<
7922
 
 *         """Poll the registered 0MQ or native fds for I/O.
7923
 
 * 
7924
 
 */
7925
 
 
7926
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_poll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7927
 
static char __pyx_doc_3zmq_4_zmq_6Poller_poll[] = "Poll the registered 0MQ or native fds for I/O.\n\n        Parameters\n        ----------\n        timeout : float, int\n            The timeout in milliseconds. If None, no timeout (infinite). This\n            is in milliseconds to be compatible with :func:`select.poll`. The\n            underlying zmq_poll uses microseconds and we convert to that in\n            this function.\n        ";
7928
 
static PyMethodDef __pyx_mdef_3zmq_4_zmq_6Poller_poll = {__Pyx_NAMESTR("poll"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Poller_poll, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Poller_poll)};
7929
 
static PyObject *__pyx_pf_3zmq_4_zmq_6Poller_poll(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7930
 
  PyObject *__pyx_v_self = 0;
7931
 
  PyObject *__pyx_v_timeout = 0;
7932
 
  PyObject *__pyx_r = NULL;
7933
 
  int __pyx_t_1;
7934
 
  PyObject *__pyx_t_2 = NULL;
7935
 
  PyObject *__pyx_t_3 = NULL;
7936
 
  PyObject *__pyx_t_4 = NULL;
7937
 
  PyObject *__pyx_t_5 = NULL;
7938
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__timeout,0};
7939
 
  __Pyx_RefNannySetupContext("poll");
7940
 
  __pyx_self = __pyx_self;
7941
 
  if (unlikely(__pyx_kwds)) {
7942
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
7943
 
    PyObject* values[2] = {0,0};
7944
 
    values[1] = ((PyObject *)Py_None);
7945
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7946
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7947
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7948
 
      case  0: break;
7949
 
      default: goto __pyx_L5_argtuple_error;
7950
 
    }
7951
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7952
 
      case  0:
7953
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
7954
 
      if (likely(values[0])) kw_args--;
7955
 
      else goto __pyx_L5_argtuple_error;
7956
 
      case  1:
7957
 
      if (kw_args > 0) {
7958
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
7959
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
7960
 
      }
7961
 
    }
7962
 
    if (unlikely(kw_args > 0)) {
7963
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "poll") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7964
 
    }
7965
 
    __pyx_v_self = values[0];
7966
 
    __pyx_v_timeout = values[1];
7967
 
  } else {
7968
 
    __pyx_v_timeout = ((PyObject *)Py_None);
7969
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7970
 
      case  2: __pyx_v_timeout = PyTuple_GET_ITEM(__pyx_args, 1);
7971
 
      case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
7972
 
      break;
7973
 
      default: goto __pyx_L5_argtuple_error;
7974
 
    }
7975
 
  }
7976
 
  goto __pyx_L4_argument_unpacking_done;
7977
 
  __pyx_L5_argtuple_error:;
7978
 
  __Pyx_RaiseArgtupleInvalid("poll", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7979
 
  __pyx_L3_error:;
7980
 
  __Pyx_AddTraceback("zmq._zmq.Poller.poll");
7981
 
  return NULL;
7982
 
  __pyx_L4_argument_unpacking_done:;
7983
 
  __Pyx_INCREF(__pyx_v_self);
7984
 
  __Pyx_INCREF(__pyx_v_timeout);
7985
 
 
7986
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1055
7987
 
 *             this function.
7988
 
 *         """
7989
 
 *         if timeout is None:             # <<<<<<<<<<<<<<
7990
 
 *             timeout = -1
7991
 
 *         # Convert from ms -> us for zmq_poll.
7992
 
 */
7993
 
  __pyx_t_1 = (__pyx_v_timeout == Py_None);
7994
 
  if (__pyx_t_1) {
7995
 
 
7996
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1056
7997
 
 *         """
7998
 
 *         if timeout is None:
7999
 
 *             timeout = -1             # <<<<<<<<<<<<<<
8000
 
 *         # Convert from ms -> us for zmq_poll.
8001
 
 *         timeout = int(timeout*1000.0)
8002
 
 */
8003
 
    __Pyx_INCREF(__pyx_int_neg_1);
8004
 
    __Pyx_DECREF(__pyx_v_timeout);
8005
 
    __pyx_v_timeout = __pyx_int_neg_1;
8006
 
    goto __pyx_L6;
8007
 
  }
8008
 
  __pyx_L6:;
8009
 
 
8010
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1058
8011
 
 *             timeout = -1
8012
 
 *         # Convert from ms -> us for zmq_poll.
8013
 
 *         timeout = int(timeout*1000.0)             # <<<<<<<<<<<<<<
8014
 
 *         if timeout < 0:
8015
 
 *             timeout = -1
8016
 
 */
8017
 
  __pyx_t_2 = PyFloat_FromDouble(1000.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8018
 
  __Pyx_GOTREF(__pyx_t_2);
8019
 
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_timeout, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8020
 
  __Pyx_GOTREF(__pyx_t_3);
8021
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8022
 
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8023
 
  __Pyx_GOTREF(__pyx_t_2);
8024
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
8025
 
  __Pyx_GIVEREF(__pyx_t_3);
8026
 
  __pyx_t_3 = 0;
8027
 
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8028
 
  __Pyx_GOTREF(__pyx_t_3);
8029
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8030
 
  __Pyx_DECREF(__pyx_v_timeout);
8031
 
  __pyx_v_timeout = __pyx_t_3;
8032
 
  __pyx_t_3 = 0;
8033
 
 
8034
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1059
8035
 
 *         # Convert from ms -> us for zmq_poll.
8036
 
 *         timeout = int(timeout*1000.0)
8037
 
 *         if timeout < 0:             # <<<<<<<<<<<<<<
8038
 
 *             timeout = -1
8039
 
 *         return _poll(self.sockets.items(), timeout=timeout)
8040
 
 */
8041
 
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_timeout, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8042
 
  __Pyx_GOTREF(__pyx_t_3);
8043
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8044
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8045
 
  if (__pyx_t_1) {
8046
 
 
8047
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1060
8048
 
 *         timeout = int(timeout*1000.0)
8049
 
 *         if timeout < 0:
8050
 
 *             timeout = -1             # <<<<<<<<<<<<<<
8051
 
 *         return _poll(self.sockets.items(), timeout=timeout)
8052
 
 * 
8053
 
 */
8054
 
    __Pyx_INCREF(__pyx_int_neg_1);
8055
 
    __Pyx_DECREF(__pyx_v_timeout);
8056
 
    __pyx_v_timeout = __pyx_int_neg_1;
8057
 
    goto __pyx_L7;
8058
 
  }
8059
 
  __pyx_L7:;
8060
 
 
8061
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1061
8062
 
 *         if timeout < 0:
8063
 
 *             timeout = -1
8064
 
 *         return _poll(self.sockets.items(), timeout=timeout)             # <<<<<<<<<<<<<<
8065
 
 * 
8066
 
 * 
8067
 
 */
8068
 
  __Pyx_XDECREF(__pyx_r);
8069
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___poll); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8070
 
  __Pyx_GOTREF(__pyx_t_3);
8071
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__sockets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8072
 
  __Pyx_GOTREF(__pyx_t_2);
8073
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8074
 
  __Pyx_GOTREF(__pyx_t_4);
8075
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8076
 
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8077
 
  __Pyx_GOTREF(__pyx_t_2);
8078
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8079
 
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8080
 
  __Pyx_GOTREF(__pyx_t_4);
8081
 
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
8082
 
  __Pyx_GIVEREF(__pyx_t_2);
8083
 
  __pyx_t_2 = 0;
8084
 
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8085
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8086
 
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__timeout), __pyx_v_timeout) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8087
 
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8088
 
  __Pyx_GOTREF(__pyx_t_5);
8089
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8090
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8091
 
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
8092
 
  __pyx_r = __pyx_t_5;
8093
 
  __pyx_t_5 = 0;
8094
 
  goto __pyx_L0;
8095
 
 
8096
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8097
 
  goto __pyx_L0;
8098
 
  __pyx_L1_error:;
8099
 
  __Pyx_XDECREF(__pyx_t_2);
8100
 
  __Pyx_XDECREF(__pyx_t_3);
8101
 
  __Pyx_XDECREF(__pyx_t_4);
8102
 
  __Pyx_XDECREF(__pyx_t_5);
8103
 
  __Pyx_AddTraceback("zmq._zmq.Poller.poll");
8104
 
  __pyx_r = NULL;
8105
 
  __pyx_L0:;
8106
 
  __Pyx_DECREF(__pyx_v_self);
8107
 
  __Pyx_DECREF(__pyx_v_timeout);
8108
 
  __Pyx_XGIVEREF(__pyx_r);
8109
 
  __Pyx_RefNannyFinishContext();
8110
 
  return __pyx_r;
8111
 
}
8112
 
 
8113
 
/* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1064
8114
 
 * 
8115
 
 * 
8116
 
 * def select(rlist, wlist, xlist, timeout=None):             # <<<<<<<<<<<<<<
8117
 
 *     """Return the result of poll as a lists of sockets ready for r/w.
8118
 
 * 
8119
 
 */
8120
 
 
8121
 
static PyObject *__pyx_pf_3zmq_4_zmq_select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8122
 
static char __pyx_doc_3zmq_4_zmq_select[] = "Return the result of poll as a lists of sockets ready for r/w.\n\n    This has the same interface as Python's built-in :func:`select` function.\n\n    Parameters\n    ----------\n    timeout : float, int\n        The timeout in seconds. This is in seconds to be compatible with\n        :func:`select.select`. The underlying zmq_poll uses microseconds and\n        we convert to that in this function.\n    ";
8123
 
static PyObject *__pyx_pf_3zmq_4_zmq_select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8124
 
  PyObject *__pyx_v_rlist = 0;
8125
 
  PyObject *__pyx_v_wlist = 0;
8126
 
  PyObject *__pyx_v_xlist = 0;
8127
 
  PyObject *__pyx_v_timeout = 0;
8128
 
  PyObject *__pyx_v_sockets;
8129
 
  PyObject *__pyx_v_s;
8130
 
  PyObject *__pyx_v_flags;
8131
 
  PyObject *__pyx_v_return_sockets;
8132
 
  PyObject *__pyx_r = NULL;
8133
 
  int __pyx_t_1;
8134
 
  PyObject *__pyx_t_2 = NULL;
8135
 
  PyObject *__pyx_t_3 = NULL;
8136
 
  Py_ssize_t __pyx_t_4;
8137
 
  PyObject *__pyx_t_5 = NULL;
8138
 
  PyObject *__pyx_t_6 = NULL;
8139
 
  PyObject *__pyx_t_7 = NULL;
8140
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__rlist,&__pyx_n_s__wlist,&__pyx_n_s__xlist,&__pyx_n_s__timeout,0};
8141
 
  __Pyx_RefNannySetupContext("select");
8142
 
  __pyx_self = __pyx_self;
8143
 
  if (unlikely(__pyx_kwds)) {
8144
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
8145
 
    PyObject* values[4] = {0,0,0,0};
8146
 
    values[3] = ((PyObject *)Py_None);
8147
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
8148
 
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8149
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8150
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8151
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8152
 
      case  0: break;
8153
 
      default: goto __pyx_L5_argtuple_error;
8154
 
    }
8155
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
8156
 
      case  0:
8157
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rlist);
8158
 
      if (likely(values[0])) kw_args--;
8159
 
      else goto __pyx_L5_argtuple_error;
8160
 
      case  1:
8161
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wlist);
8162
 
      if (likely(values[1])) kw_args--;
8163
 
      else {
8164
 
        __Pyx_RaiseArgtupleInvalid("select", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8165
 
      }
8166
 
      case  2:
8167
 
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xlist);
8168
 
      if (likely(values[2])) kw_args--;
8169
 
      else {
8170
 
        __Pyx_RaiseArgtupleInvalid("select", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8171
 
      }
8172
 
      case  3:
8173
 
      if (kw_args > 0) {
8174
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
8175
 
        if (unlikely(value)) { values[3] = value; kw_args--; }
8176
 
      }
8177
 
    }
8178
 
    if (unlikely(kw_args > 0)) {
8179
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "select") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8180
 
    }
8181
 
    __pyx_v_rlist = values[0];
8182
 
    __pyx_v_wlist = values[1];
8183
 
    __pyx_v_xlist = values[2];
8184
 
    __pyx_v_timeout = values[3];
8185
 
  } else {
8186
 
    __pyx_v_timeout = ((PyObject *)Py_None);
8187
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
8188
 
      case  4:
8189
 
      __pyx_v_timeout = PyTuple_GET_ITEM(__pyx_args, 3);
8190
 
      case  3:
8191
 
      __pyx_v_xlist = PyTuple_GET_ITEM(__pyx_args, 2);
8192
 
      __pyx_v_wlist = PyTuple_GET_ITEM(__pyx_args, 1);
8193
 
      __pyx_v_rlist = PyTuple_GET_ITEM(__pyx_args, 0);
8194
 
      break;
8195
 
      default: goto __pyx_L5_argtuple_error;
8196
 
    }
8197
 
  }
8198
 
  goto __pyx_L4_argument_unpacking_done;
8199
 
  __pyx_L5_argtuple_error:;
8200
 
  __Pyx_RaiseArgtupleInvalid("select", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8201
 
  __pyx_L3_error:;
8202
 
  __Pyx_AddTraceback("zmq._zmq.select");
8203
 
  return NULL;
8204
 
  __pyx_L4_argument_unpacking_done:;
8205
 
  __Pyx_INCREF(__pyx_v_rlist);
8206
 
  __Pyx_INCREF(__pyx_v_wlist);
8207
 
  __Pyx_INCREF(__pyx_v_xlist);
8208
 
  __Pyx_INCREF(__pyx_v_timeout);
8209
 
  __pyx_v_sockets = Py_None; __Pyx_INCREF(Py_None);
8210
 
  __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
8211
 
  __pyx_v_flags = Py_None; __Pyx_INCREF(Py_None);
8212
 
  __pyx_v_return_sockets = Py_None; __Pyx_INCREF(Py_None);
8213
 
 
8214
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1076
8215
 
 *         we convert to that in this function.
8216
 
 *     """
8217
 
 *     if timeout is None:             # <<<<<<<<<<<<<<
8218
 
 *         timeout = -1
8219
 
 *     # Convert from sec -> us for zmq_poll.
8220
 
 */
8221
 
  __pyx_t_1 = (__pyx_v_timeout == Py_None);
8222
 
  if (__pyx_t_1) {
8223
 
 
8224
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1077
8225
 
 *     """
8226
 
 *     if timeout is None:
8227
 
 *         timeout = -1             # <<<<<<<<<<<<<<
8228
 
 *     # Convert from sec -> us for zmq_poll.
8229
 
 *     timeout = int(timeout*1000000.0)
8230
 
 */
8231
 
    __Pyx_INCREF(__pyx_int_neg_1);
8232
 
    __Pyx_DECREF(__pyx_v_timeout);
8233
 
    __pyx_v_timeout = __pyx_int_neg_1;
8234
 
    goto __pyx_L6;
8235
 
  }
8236
 
  __pyx_L6:;
8237
 
 
8238
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1079
8239
 
 *         timeout = -1
8240
 
 *     # Convert from sec -> us for zmq_poll.
8241
 
 *     timeout = int(timeout*1000000.0)             # <<<<<<<<<<<<<<
8242
 
 *     if timeout < 0:
8243
 
 *         timeout = -1
8244
 
 */
8245
 
  __pyx_t_2 = PyFloat_FromDouble(1000000.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8246
 
  __Pyx_GOTREF(__pyx_t_2);
8247
 
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_timeout, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8248
 
  __Pyx_GOTREF(__pyx_t_3);
8249
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8250
 
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8251
 
  __Pyx_GOTREF(__pyx_t_2);
8252
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
8253
 
  __Pyx_GIVEREF(__pyx_t_3);
8254
 
  __pyx_t_3 = 0;
8255
 
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8256
 
  __Pyx_GOTREF(__pyx_t_3);
8257
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8258
 
  __Pyx_DECREF(__pyx_v_timeout);
8259
 
  __pyx_v_timeout = __pyx_t_3;
8260
 
  __pyx_t_3 = 0;
8261
 
 
8262
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1080
8263
 
 *     # Convert from sec -> us for zmq_poll.
8264
 
 *     timeout = int(timeout*1000000.0)
8265
 
 *     if timeout < 0:             # <<<<<<<<<<<<<<
8266
 
 *         timeout = -1
8267
 
 *     sockets = []
8268
 
 */
8269
 
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_timeout, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8270
 
  __Pyx_GOTREF(__pyx_t_3);
8271
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8272
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8273
 
  if (__pyx_t_1) {
8274
 
 
8275
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1081
8276
 
 *     timeout = int(timeout*1000000.0)
8277
 
 *     if timeout < 0:
8278
 
 *         timeout = -1             # <<<<<<<<<<<<<<
8279
 
 *     sockets = []
8280
 
 *     for s in set(rlist + wlist + xlist):
8281
 
 */
8282
 
    __Pyx_INCREF(__pyx_int_neg_1);
8283
 
    __Pyx_DECREF(__pyx_v_timeout);
8284
 
    __pyx_v_timeout = __pyx_int_neg_1;
8285
 
    goto __pyx_L7;
8286
 
  }
8287
 
  __pyx_L7:;
8288
 
 
8289
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1082
8290
 
 *     if timeout < 0:
8291
 
 *         timeout = -1
8292
 
 *     sockets = []             # <<<<<<<<<<<<<<
8293
 
 *     for s in set(rlist + wlist + xlist):
8294
 
 *         flags = 0
8295
 
 */
8296
 
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8297
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
8298
 
  __Pyx_DECREF(__pyx_v_sockets);
8299
 
  __pyx_v_sockets = ((PyObject *)__pyx_t_3);
8300
 
  __pyx_t_3 = 0;
8301
 
 
8302
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1083
8303
 
 *         timeout = -1
8304
 
 *     sockets = []
8305
 
 *     for s in set(rlist + wlist + xlist):             # <<<<<<<<<<<<<<
8306
 
 *         flags = 0
8307
 
 *         if s in rlist:
8308
 
 */
8309
 
  __pyx_t_3 = PyNumber_Add(__pyx_v_rlist, __pyx_v_wlist); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8310
 
  __Pyx_GOTREF(__pyx_t_3);
8311
 
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_xlist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8312
 
  __Pyx_GOTREF(__pyx_t_2);
8313
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8314
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8315
 
  __Pyx_GOTREF(__pyx_t_3);
8316
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
8317
 
  __Pyx_GIVEREF(__pyx_t_2);
8318
 
  __pyx_t_2 = 0;
8319
 
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PySet_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8320
 
  __Pyx_GOTREF(__pyx_t_2);
8321
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8322
 
  __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8323
 
  __Pyx_GOTREF(__pyx_t_3);
8324
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8325
 
  for (;;) {
8326
 
    {
8327
 
      __pyx_t_2 = PyIter_Next(__pyx_t_3);
8328
 
      if (!__pyx_t_2) {
8329
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8330
 
        break;
8331
 
      }
8332
 
      __Pyx_GOTREF(__pyx_t_2);
8333
 
    }
8334
 
    __Pyx_DECREF(__pyx_v_s);
8335
 
    __pyx_v_s = __pyx_t_2;
8336
 
    __pyx_t_2 = 0;
8337
 
 
8338
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1084
8339
 
 *     sockets = []
8340
 
 *     for s in set(rlist + wlist + xlist):
8341
 
 *         flags = 0             # <<<<<<<<<<<<<<
8342
 
 *         if s in rlist:
8343
 
 *             flags |= POLLIN
8344
 
 */
8345
 
    __Pyx_INCREF(__pyx_int_0);
8346
 
    __Pyx_DECREF(__pyx_v_flags);
8347
 
    __pyx_v_flags = __pyx_int_0;
8348
 
 
8349
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1085
8350
 
 *     for s in set(rlist + wlist + xlist):
8351
 
 *         flags = 0
8352
 
 *         if s in rlist:             # <<<<<<<<<<<<<<
8353
 
 *             flags |= POLLIN
8354
 
 *         if s in wlist:
8355
 
 */
8356
 
    __pyx_t_1 = ((PySequence_Contains(__pyx_v_rlist, __pyx_v_s))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8357
 
    if (__pyx_t_1) {
8358
 
 
8359
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1086
8360
 
 *         flags = 0
8361
 
 *         if s in rlist:
8362
 
 *             flags |= POLLIN             # <<<<<<<<<<<<<<
8363
 
 *         if s in wlist:
8364
 
 *             flags |= POLLOUT
8365
 
 */
8366
 
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLIN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8367
 
      __Pyx_GOTREF(__pyx_t_2);
8368
 
      __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8369
 
      __Pyx_GOTREF(__pyx_t_5);
8370
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8371
 
      __Pyx_DECREF(__pyx_v_flags);
8372
 
      __pyx_v_flags = __pyx_t_5;
8373
 
      __pyx_t_5 = 0;
8374
 
      goto __pyx_L10;
8375
 
    }
8376
 
    __pyx_L10:;
8377
 
 
8378
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1087
8379
 
 *         if s in rlist:
8380
 
 *             flags |= POLLIN
8381
 
 *         if s in wlist:             # <<<<<<<<<<<<<<
8382
 
 *             flags |= POLLOUT
8383
 
 *         if s in xlist:
8384
 
 */
8385
 
    __pyx_t_1 = ((PySequence_Contains(__pyx_v_wlist, __pyx_v_s))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8386
 
    if (__pyx_t_1) {
8387
 
 
8388
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1088
8389
 
 *             flags |= POLLIN
8390
 
 *         if s in wlist:
8391
 
 *             flags |= POLLOUT             # <<<<<<<<<<<<<<
8392
 
 *         if s in xlist:
8393
 
 *             flags |= POLLERR
8394
 
 */
8395
 
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLOUT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8396
 
      __Pyx_GOTREF(__pyx_t_5);
8397
 
      __pyx_t_2 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8398
 
      __Pyx_GOTREF(__pyx_t_2);
8399
 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8400
 
      __Pyx_DECREF(__pyx_v_flags);
8401
 
      __pyx_v_flags = __pyx_t_2;
8402
 
      __pyx_t_2 = 0;
8403
 
      goto __pyx_L11;
8404
 
    }
8405
 
    __pyx_L11:;
8406
 
 
8407
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1089
8408
 
 *         if s in wlist:
8409
 
 *             flags |= POLLOUT
8410
 
 *         if s in xlist:             # <<<<<<<<<<<<<<
8411
 
 *             flags |= POLLERR
8412
 
 *         sockets.append((s, flags))
8413
 
 */
8414
 
    __pyx_t_1 = ((PySequence_Contains(__pyx_v_xlist, __pyx_v_s))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8415
 
    if (__pyx_t_1) {
8416
 
 
8417
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1090
8418
 
 *             flags |= POLLOUT
8419
 
 *         if s in xlist:
8420
 
 *             flags |= POLLERR             # <<<<<<<<<<<<<<
8421
 
 *         sockets.append((s, flags))
8422
 
 *     return_sockets = _poll(sockets, timeout)
8423
 
 */
8424
 
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLERR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8425
 
      __Pyx_GOTREF(__pyx_t_2);
8426
 
      __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8427
 
      __Pyx_GOTREF(__pyx_t_5);
8428
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8429
 
      __Pyx_DECREF(__pyx_v_flags);
8430
 
      __pyx_v_flags = __pyx_t_5;
8431
 
      __pyx_t_5 = 0;
8432
 
      goto __pyx_L12;
8433
 
    }
8434
 
    __pyx_L12:;
8435
 
 
8436
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1091
8437
 
 *         if s in xlist:
8438
 
 *             flags |= POLLERR
8439
 
 *         sockets.append((s, flags))             # <<<<<<<<<<<<<<
8440
 
 *     return_sockets = _poll(sockets, timeout)
8441
 
 *     rlist, wlist, xlist = [], [], []
8442
 
 */
8443
 
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8444
 
    __Pyx_GOTREF(__pyx_t_5);
8445
 
    __Pyx_INCREF(__pyx_v_s);
8446
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s);
8447
 
    __Pyx_GIVEREF(__pyx_v_s);
8448
 
    __Pyx_INCREF(__pyx_v_flags);
8449
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_flags);
8450
 
    __Pyx_GIVEREF(__pyx_v_flags);
8451
 
    __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_sockets, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8452
 
    __Pyx_GOTREF(__pyx_t_2);
8453
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8454
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8455
 
  }
8456
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8457
 
 
8458
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1092
8459
 
 *             flags |= POLLERR
8460
 
 *         sockets.append((s, flags))
8461
 
 *     return_sockets = _poll(sockets, timeout)             # <<<<<<<<<<<<<<
8462
 
 *     rlist, wlist, xlist = [], [], []
8463
 
 *     for s, flags in return_sockets:
8464
 
 */
8465
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___poll); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8466
 
  __Pyx_GOTREF(__pyx_t_3);
8467
 
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8468
 
  __Pyx_GOTREF(__pyx_t_2);
8469
 
  __Pyx_INCREF(__pyx_v_sockets);
8470
 
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sockets);
8471
 
  __Pyx_GIVEREF(__pyx_v_sockets);
8472
 
  __Pyx_INCREF(__pyx_v_timeout);
8473
 
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_timeout);
8474
 
  __Pyx_GIVEREF(__pyx_v_timeout);
8475
 
  __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8476
 
  __Pyx_GOTREF(__pyx_t_5);
8477
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8478
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8479
 
  __Pyx_DECREF(__pyx_v_return_sockets);
8480
 
  __pyx_v_return_sockets = __pyx_t_5;
8481
 
  __pyx_t_5 = 0;
8482
 
 
8483
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1093
8484
 
 *         sockets.append((s, flags))
8485
 
 *     return_sockets = _poll(sockets, timeout)
8486
 
 *     rlist, wlist, xlist = [], [], []             # <<<<<<<<<<<<<<
8487
 
 *     for s, flags in return_sockets:
8488
 
 *         if flags & POLLIN:
8489
 
 */
8490
 
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8491
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8492
 
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8493
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8494
 
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8495
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
8496
 
  __Pyx_DECREF(__pyx_v_rlist);
8497
 
  __pyx_v_rlist = ((PyObject *)__pyx_t_5);
8498
 
  __pyx_t_5 = 0;
8499
 
  __Pyx_DECREF(__pyx_v_wlist);
8500
 
  __pyx_v_wlist = ((PyObject *)__pyx_t_2);
8501
 
  __pyx_t_2 = 0;
8502
 
  __Pyx_DECREF(__pyx_v_xlist);
8503
 
  __pyx_v_xlist = ((PyObject *)__pyx_t_3);
8504
 
  __pyx_t_3 = 0;
8505
 
 
8506
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1094
8507
 
 *     return_sockets = _poll(sockets, timeout)
8508
 
 *     rlist, wlist, xlist = [], [], []
8509
 
 *     for s, flags in return_sockets:             # <<<<<<<<<<<<<<
8510
 
 *         if flags & POLLIN:
8511
 
 *             rlist.append(s)
8512
 
 */
8513
 
  if (PyList_CheckExact(__pyx_v_return_sockets) || PyTuple_CheckExact(__pyx_v_return_sockets)) {
8514
 
    __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_return_sockets; __Pyx_INCREF(__pyx_t_3);
8515
 
  } else {
8516
 
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_return_sockets); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8517
 
    __Pyx_GOTREF(__pyx_t_3);
8518
 
  }
8519
 
  for (;;) {
8520
 
    if (likely(PyList_CheckExact(__pyx_t_3))) {
8521
 
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
8522
 
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8523
 
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
8524
 
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8525
 
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
8526
 
    } else {
8527
 
      __pyx_t_2 = PyIter_Next(__pyx_t_3);
8528
 
      if (!__pyx_t_2) {
8529
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8530
 
        break;
8531
 
      }
8532
 
      __Pyx_GOTREF(__pyx_t_2);
8533
 
    }
8534
 
    if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
8535
 
      PyObject* tuple = __pyx_t_2;
8536
 
      __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5);
8537
 
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);
8538
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8539
 
      __Pyx_DECREF(__pyx_v_s);
8540
 
      __pyx_v_s = __pyx_t_5;
8541
 
      __pyx_t_5 = 0;
8542
 
      __Pyx_DECREF(__pyx_v_flags);
8543
 
      __pyx_v_flags = __pyx_t_6;
8544
 
      __pyx_t_6 = 0;
8545
 
    } else {
8546
 
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8547
 
      __Pyx_GOTREF(__pyx_t_7);
8548
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8549
 
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8550
 
      __Pyx_GOTREF(__pyx_t_5);
8551
 
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8552
 
      __Pyx_GOTREF(__pyx_t_6);
8553
 
      if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8554
 
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8555
 
      __Pyx_DECREF(__pyx_v_s);
8556
 
      __pyx_v_s = __pyx_t_5;
8557
 
      __pyx_t_5 = 0;
8558
 
      __Pyx_DECREF(__pyx_v_flags);
8559
 
      __pyx_v_flags = __pyx_t_6;
8560
 
      __pyx_t_6 = 0;
8561
 
    }
8562
 
 
8563
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1095
8564
 
 *     rlist, wlist, xlist = [], [], []
8565
 
 *     for s, flags in return_sockets:
8566
 
 *         if flags & POLLIN:             # <<<<<<<<<<<<<<
8567
 
 *             rlist.append(s)
8568
 
 *         if flags & POLLOUT:
8569
 
 */
8570
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLIN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8571
 
    __Pyx_GOTREF(__pyx_t_2);
8572
 
    __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8573
 
    __Pyx_GOTREF(__pyx_t_6);
8574
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8575
 
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8576
 
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8577
 
    if (__pyx_t_1) {
8578
 
 
8579
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1096
8580
 
 *     for s, flags in return_sockets:
8581
 
 *         if flags & POLLIN:
8582
 
 *             rlist.append(s)             # <<<<<<<<<<<<<<
8583
 
 *         if flags & POLLOUT:
8584
 
 *             wlist.append(s)
8585
 
 */
8586
 
      __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_rlist, __pyx_v_s); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8587
 
      __Pyx_GOTREF(__pyx_t_6);
8588
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8589
 
      goto __pyx_L15;
8590
 
    }
8591
 
    __pyx_L15:;
8592
 
 
8593
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1097
8594
 
 *         if flags & POLLIN:
8595
 
 *             rlist.append(s)
8596
 
 *         if flags & POLLOUT:             # <<<<<<<<<<<<<<
8597
 
 *             wlist.append(s)
8598
 
 *         if flags & POLLERR:
8599
 
 */
8600
 
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLOUT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8601
 
    __Pyx_GOTREF(__pyx_t_6);
8602
 
    __pyx_t_2 = PyNumber_And(__pyx_v_flags, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8603
 
    __Pyx_GOTREF(__pyx_t_2);
8604
 
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8605
 
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8606
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8607
 
    if (__pyx_t_1) {
8608
 
 
8609
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1098
8610
 
 *             rlist.append(s)
8611
 
 *         if flags & POLLOUT:
8612
 
 *             wlist.append(s)             # <<<<<<<<<<<<<<
8613
 
 *         if flags & POLLERR:
8614
 
 *             xlist.append(s)
8615
 
 */
8616
 
      __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_wlist, __pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8617
 
      __Pyx_GOTREF(__pyx_t_2);
8618
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8619
 
      goto __pyx_L16;
8620
 
    }
8621
 
    __pyx_L16:;
8622
 
 
8623
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1099
8624
 
 *         if flags & POLLOUT:
8625
 
 *             wlist.append(s)
8626
 
 *         if flags & POLLERR:             # <<<<<<<<<<<<<<
8627
 
 *             xlist.append(s)
8628
 
 *     return rlist, wlist, xlist
8629
 
 */
8630
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLERR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8631
 
    __Pyx_GOTREF(__pyx_t_2);
8632
 
    __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8633
 
    __Pyx_GOTREF(__pyx_t_6);
8634
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8635
 
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8636
 
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8637
 
    if (__pyx_t_1) {
8638
 
 
8639
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1100
8640
 
 *             wlist.append(s)
8641
 
 *         if flags & POLLERR:
8642
 
 *             xlist.append(s)             # <<<<<<<<<<<<<<
8643
 
 *     return rlist, wlist, xlist
8644
 
 * 
8645
 
 */
8646
 
      __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_xlist, __pyx_v_s); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8647
 
      __Pyx_GOTREF(__pyx_t_6);
8648
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8649
 
      goto __pyx_L17;
8650
 
    }
8651
 
    __pyx_L17:;
8652
 
  }
8653
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8654
 
 
8655
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1101
8656
 
 *         if flags & POLLERR:
8657
 
 *             xlist.append(s)
8658
 
 *     return rlist, wlist, xlist             # <<<<<<<<<<<<<<
8659
 
 * 
8660
 
 * 
8661
 
 */
8662
 
  __Pyx_XDECREF(__pyx_r);
8663
 
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8664
 
  __Pyx_GOTREF(__pyx_t_3);
8665
 
  __Pyx_INCREF(__pyx_v_rlist);
8666
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rlist);
8667
 
  __Pyx_GIVEREF(__pyx_v_rlist);
8668
 
  __Pyx_INCREF(__pyx_v_wlist);
8669
 
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_wlist);
8670
 
  __Pyx_GIVEREF(__pyx_v_wlist);
8671
 
  __Pyx_INCREF(__pyx_v_xlist);
8672
 
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_xlist);
8673
 
  __Pyx_GIVEREF(__pyx_v_xlist);
8674
 
  __pyx_r = __pyx_t_3;
8675
 
  __pyx_t_3 = 0;
8676
 
  goto __pyx_L0;
8677
 
 
8678
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8679
 
  goto __pyx_L0;
8680
 
  __pyx_L1_error:;
8681
 
  __Pyx_XDECREF(__pyx_t_2);
8682
 
  __Pyx_XDECREF(__pyx_t_3);
8683
 
  __Pyx_XDECREF(__pyx_t_5);
8684
 
  __Pyx_XDECREF(__pyx_t_6);
8685
 
  __Pyx_XDECREF(__pyx_t_7);
8686
 
  __Pyx_AddTraceback("zmq._zmq.select");
8687
 
  __pyx_r = NULL;
8688
 
  __pyx_L0:;
8689
 
  __Pyx_DECREF(__pyx_v_sockets);
8690
 
  __Pyx_DECREF(__pyx_v_s);
8691
 
  __Pyx_DECREF(__pyx_v_flags);
8692
 
  __Pyx_DECREF(__pyx_v_return_sockets);
8693
 
  __Pyx_DECREF(__pyx_v_rlist);
8694
 
  __Pyx_DECREF(__pyx_v_wlist);
8695
 
  __Pyx_DECREF(__pyx_v_xlist);
8696
 
  __Pyx_DECREF(__pyx_v_timeout);
8697
 
  __Pyx_XGIVEREF(__pyx_r);
8698
 
  __Pyx_RefNannyFinishContext();
8699
 
  return __pyx_r;
8700
 
}
8701
 
static struct __pyx_vtabstruct_3zmq_4_zmq_Message __pyx_vtable_3zmq_4_zmq_Message;
8702
 
 
8703
 
static PyObject *__pyx_tp_new_3zmq_4_zmq_Message(PyTypeObject *t, PyObject *a, PyObject *k) {
8704
 
  struct __pyx_obj_3zmq_4_zmq_Message *p;
8705
 
  PyObject *o = (*t->tp_alloc)(t, 0);
8706
 
  if (!o) return 0;
8707
 
  p = ((struct __pyx_obj_3zmq_4_zmq_Message *)o);
8708
 
  p->__pyx_vtab = __pyx_vtabptr_3zmq_4_zmq_Message;
8709
 
  p->data = Py_None; Py_INCREF(Py_None);
8710
 
  if (__pyx_pf_3zmq_4_zmq_7Message___cinit__(o, a, k) < 0) {
8711
 
    Py_DECREF(o); o = 0;
8712
 
  }
8713
 
  return o;
8714
 
}
8715
 
 
8716
 
static void __pyx_tp_dealloc_3zmq_4_zmq_Message(PyObject *o) {
8717
 
  struct __pyx_obj_3zmq_4_zmq_Message *p = (struct __pyx_obj_3zmq_4_zmq_Message *)o;
8718
 
  {
8719
 
    PyObject *etype, *eval, *etb;
8720
 
    PyErr_Fetch(&etype, &eval, &etb);
8721
 
    ++Py_REFCNT(o);
8722
 
    __pyx_pf_3zmq_4_zmq_7Message___dealloc__(o);
8723
 
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
8724
 
    --Py_REFCNT(o);
8725
 
    PyErr_Restore(etype, eval, etb);
8726
 
  }
8727
 
  Py_XDECREF(p->data);
8728
 
  (*Py_TYPE(o)->tp_free)(o);
8729
 
}
8730
 
 
8731
 
static int __pyx_tp_traverse_3zmq_4_zmq_Message(PyObject *o, visitproc v, void *a) {
8732
 
  int e;
8733
 
  struct __pyx_obj_3zmq_4_zmq_Message *p = (struct __pyx_obj_3zmq_4_zmq_Message *)o;
8734
 
  if (p->data) {
8735
 
    e = (*v)(p->data, a); if (e) return e;
8736
 
  }
8737
 
  return 0;
8738
 
}
8739
 
 
8740
 
static int __pyx_tp_clear_3zmq_4_zmq_Message(PyObject *o) {
8741
 
  struct __pyx_obj_3zmq_4_zmq_Message *p = (struct __pyx_obj_3zmq_4_zmq_Message *)o;
8742
 
  PyObject* tmp;
8743
 
  tmp = ((PyObject*)p->data);
8744
 
  p->data = Py_None; Py_INCREF(Py_None);
8745
 
  Py_XDECREF(tmp);
8746
 
  return 0;
8747
 
}
8748
 
 
8749
 
static struct PyMethodDef __pyx_methods_3zmq_4_zmq_Message[] = {
8750
 
  {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pf_3zmq_4_zmq_7Message___copy__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_7Message___copy__)},
8751
 
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_3zmq_4_zmq_7Message___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_7Message___str__)},
8752
 
  {0, 0, 0, 0}
8753
 
};
8754
 
 
8755
 
static PyNumberMethods __pyx_tp_as_number_Message = {
8756
 
  0, /*nb_add*/
8757
 
  0, /*nb_subtract*/
8758
 
  0, /*nb_multiply*/
8759
 
  #if PY_MAJOR_VERSION < 3
8760
 
  0, /*nb_divide*/
8761
 
  #endif
8762
 
  0, /*nb_remainder*/
8763
 
  0, /*nb_divmod*/
8764
 
  0, /*nb_power*/
8765
 
  0, /*nb_negative*/
8766
 
  0, /*nb_positive*/
8767
 
  0, /*nb_absolute*/
8768
 
  0, /*nb_nonzero*/
8769
 
  0, /*nb_invert*/
8770
 
  0, /*nb_lshift*/
8771
 
  0, /*nb_rshift*/
8772
 
  0, /*nb_and*/
8773
 
  0, /*nb_xor*/
8774
 
  0, /*nb_or*/
8775
 
  #if PY_MAJOR_VERSION < 3
8776
 
  0, /*nb_coerce*/
8777
 
  #endif
8778
 
  0, /*nb_int*/
8779
 
  #if PY_MAJOR_VERSION >= 3
8780
 
  0, /*reserved*/
8781
 
  #else
8782
 
  0, /*nb_long*/
8783
 
  #endif
8784
 
  0, /*nb_float*/
8785
 
  #if PY_MAJOR_VERSION < 3
8786
 
  0, /*nb_oct*/
8787
 
  #endif
8788
 
  #if PY_MAJOR_VERSION < 3
8789
 
  0, /*nb_hex*/
8790
 
  #endif
8791
 
  0, /*nb_inplace_add*/
8792
 
  0, /*nb_inplace_subtract*/
8793
 
  0, /*nb_inplace_multiply*/
8794
 
  #if PY_MAJOR_VERSION < 3
8795
 
  0, /*nb_inplace_divide*/
8796
 
  #endif
8797
 
  0, /*nb_inplace_remainder*/
8798
 
  0, /*nb_inplace_power*/
8799
 
  0, /*nb_inplace_lshift*/
8800
 
  0, /*nb_inplace_rshift*/
8801
 
  0, /*nb_inplace_and*/
8802
 
  0, /*nb_inplace_xor*/
8803
 
  0, /*nb_inplace_or*/
8804
 
  0, /*nb_floor_divide*/
8805
 
  0, /*nb_true_divide*/
8806
 
  0, /*nb_inplace_floor_divide*/
8807
 
  0, /*nb_inplace_true_divide*/
8808
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
8809
 
  0, /*nb_index*/
8810
 
  #endif
8811
 
};
8812
 
 
8813
 
static PySequenceMethods __pyx_tp_as_sequence_Message = {
8814
 
  __pyx_pf_3zmq_4_zmq_7Message___len__, /*sq_length*/
8815
 
  0, /*sq_concat*/
8816
 
  0, /*sq_repeat*/
8817
 
  0, /*sq_item*/
8818
 
  0, /*sq_slice*/
8819
 
  0, /*sq_ass_item*/
8820
 
  0, /*sq_ass_slice*/
8821
 
  0, /*sq_contains*/
8822
 
  0, /*sq_inplace_concat*/
8823
 
  0, /*sq_inplace_repeat*/
8824
 
};
8825
 
 
8826
 
static PyMappingMethods __pyx_tp_as_mapping_Message = {
8827
 
  __pyx_pf_3zmq_4_zmq_7Message___len__, /*mp_length*/
8828
 
  0, /*mp_subscript*/
8829
 
  0, /*mp_ass_subscript*/
8830
 
};
8831
 
 
8832
 
static PyBufferProcs __pyx_tp_as_buffer_Message = {
8833
 
  #if PY_MAJOR_VERSION < 3
8834
 
  0, /*bf_getreadbuffer*/
8835
 
  #endif
8836
 
  #if PY_MAJOR_VERSION < 3
8837
 
  0, /*bf_getwritebuffer*/
8838
 
  #endif
8839
 
  #if PY_MAJOR_VERSION < 3
8840
 
  0, /*bf_getsegcount*/
8841
 
  #endif
8842
 
  #if PY_MAJOR_VERSION < 3
8843
 
  0, /*bf_getcharbuffer*/
8844
 
  #endif
8845
 
  #if PY_VERSION_HEX >= 0x02060000
8846
 
  0, /*bf_getbuffer*/
8847
 
  #endif
8848
 
  #if PY_VERSION_HEX >= 0x02060000
8849
 
  0, /*bf_releasebuffer*/
8850
 
  #endif
8851
 
};
8852
 
 
8853
 
PyTypeObject __pyx_type_3zmq_4_zmq_Message = {
8854
 
  PyVarObject_HEAD_INIT(0, 0)
8855
 
  __Pyx_NAMESTR("zmq._zmq.Message"), /*tp_name*/
8856
 
  sizeof(struct __pyx_obj_3zmq_4_zmq_Message), /*tp_basicsize*/
8857
 
  0, /*tp_itemsize*/
8858
 
  __pyx_tp_dealloc_3zmq_4_zmq_Message, /*tp_dealloc*/
8859
 
  0, /*tp_print*/
8860
 
  0, /*tp_getattr*/
8861
 
  0, /*tp_setattr*/
8862
 
  0, /*tp_compare*/
8863
 
  0, /*tp_repr*/
8864
 
  &__pyx_tp_as_number_Message, /*tp_as_number*/
8865
 
  &__pyx_tp_as_sequence_Message, /*tp_as_sequence*/
8866
 
  &__pyx_tp_as_mapping_Message, /*tp_as_mapping*/
8867
 
  0, /*tp_hash*/
8868
 
  0, /*tp_call*/
8869
 
  __pyx_pf_3zmq_4_zmq_7Message___str__, /*tp_str*/
8870
 
  0, /*tp_getattro*/
8871
 
  0, /*tp_setattro*/
8872
 
  &__pyx_tp_as_buffer_Message, /*tp_as_buffer*/
8873
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8874
 
  __Pyx_DOCSTR("A Message class for non-copy send/recvs.\n\n    This class is only needed if you want to do non-copying send and recvs.\n    When you pass a string to this class, like ``Message(s)``, the \n    ref-count of s is increased by two: once because Message saves s as \n    an instance attribute and another because a ZMQ message is created that\n    points to the buffer of s. This second ref-count increase makes sure\n    that s lives until all messages that use it have been sent. Once 0MQ\n    sends all the messages and it doesn't need the buffer of s, 0MQ will call\n    Py_DECREF(s).\n    "), /*tp_doc*/
8875
 
  __pyx_tp_traverse_3zmq_4_zmq_Message, /*tp_traverse*/
8876
 
  __pyx_tp_clear_3zmq_4_zmq_Message, /*tp_clear*/
8877
 
  0, /*tp_richcompare*/
8878
 
  0, /*tp_weaklistoffset*/
8879
 
  0, /*tp_iter*/
8880
 
  0, /*tp_iternext*/
8881
 
  __pyx_methods_3zmq_4_zmq_Message, /*tp_methods*/
8882
 
  0, /*tp_members*/
8883
 
  0, /*tp_getset*/
8884
 
  0, /*tp_base*/
8885
 
  0, /*tp_dict*/
8886
 
  0, /*tp_descr_get*/
8887
 
  0, /*tp_descr_set*/
8888
 
  0, /*tp_dictoffset*/
8889
 
  0, /*tp_init*/
8890
 
  0, /*tp_alloc*/
8891
 
  __pyx_tp_new_3zmq_4_zmq_Message, /*tp_new*/
8892
 
  0, /*tp_free*/
8893
 
  0, /*tp_is_gc*/
8894
 
  0, /*tp_bases*/
8895
 
  0, /*tp_mro*/
8896
 
  0, /*tp_cache*/
8897
 
  0, /*tp_subclasses*/
8898
 
  0, /*tp_weaklist*/
8899
 
  0, /*tp_del*/
8900
 
  #if PY_VERSION_HEX >= 0x02060000
8901
 
  0, /*tp_version_tag*/
8902
 
  #endif
8903
 
};
8904
 
 
8905
 
static PyObject *__pyx_tp_new_3zmq_4_zmq_Context(PyTypeObject *t, PyObject *a, PyObject *k) {
8906
 
  PyObject *o = (*t->tp_alloc)(t, 0);
8907
 
  if (!o) return 0;
8908
 
  if (__pyx_pf_3zmq_4_zmq_7Context___cinit__(o, a, k) < 0) {
8909
 
    Py_DECREF(o); o = 0;
8910
 
  }
8911
 
  return o;
8912
 
}
8913
 
 
8914
 
static void __pyx_tp_dealloc_3zmq_4_zmq_Context(PyObject *o) {
8915
 
  {
8916
 
    PyObject *etype, *eval, *etb;
8917
 
    PyErr_Fetch(&etype, &eval, &etb);
8918
 
    ++Py_REFCNT(o);
8919
 
    __pyx_pf_3zmq_4_zmq_7Context___dealloc__(o);
8920
 
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
8921
 
    --Py_REFCNT(o);
8922
 
    PyErr_Restore(etype, eval, etb);
8923
 
  }
8924
 
  (*Py_TYPE(o)->tp_free)(o);
8925
 
}
8926
 
 
8927
 
static struct PyMethodDef __pyx_methods_3zmq_4_zmq_Context[] = {
8928
 
  {__Pyx_NAMESTR("socket"), (PyCFunction)__pyx_pf_3zmq_4_zmq_7Context_socket, METH_O, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_7Context_socket)},
8929
 
  {0, 0, 0, 0}
8930
 
};
8931
 
 
8932
 
static PyNumberMethods __pyx_tp_as_number_Context = {
8933
 
  0, /*nb_add*/
8934
 
  0, /*nb_subtract*/
8935
 
  0, /*nb_multiply*/
8936
 
  #if PY_MAJOR_VERSION < 3
8937
 
  0, /*nb_divide*/
8938
 
  #endif
8939
 
  0, /*nb_remainder*/
8940
 
  0, /*nb_divmod*/
8941
 
  0, /*nb_power*/
8942
 
  0, /*nb_negative*/
8943
 
  0, /*nb_positive*/
8944
 
  0, /*nb_absolute*/
8945
 
  0, /*nb_nonzero*/
8946
 
  0, /*nb_invert*/
8947
 
  0, /*nb_lshift*/
8948
 
  0, /*nb_rshift*/
8949
 
  0, /*nb_and*/
8950
 
  0, /*nb_xor*/
8951
 
  0, /*nb_or*/
8952
 
  #if PY_MAJOR_VERSION < 3
8953
 
  0, /*nb_coerce*/
8954
 
  #endif
8955
 
  0, /*nb_int*/
8956
 
  #if PY_MAJOR_VERSION >= 3
8957
 
  0, /*reserved*/
8958
 
  #else
8959
 
  0, /*nb_long*/
8960
 
  #endif
8961
 
  0, /*nb_float*/
8962
 
  #if PY_MAJOR_VERSION < 3
8963
 
  0, /*nb_oct*/
8964
 
  #endif
8965
 
  #if PY_MAJOR_VERSION < 3
8966
 
  0, /*nb_hex*/
8967
 
  #endif
8968
 
  0, /*nb_inplace_add*/
8969
 
  0, /*nb_inplace_subtract*/
8970
 
  0, /*nb_inplace_multiply*/
8971
 
  #if PY_MAJOR_VERSION < 3
8972
 
  0, /*nb_inplace_divide*/
8973
 
  #endif
8974
 
  0, /*nb_inplace_remainder*/
8975
 
  0, /*nb_inplace_power*/
8976
 
  0, /*nb_inplace_lshift*/
8977
 
  0, /*nb_inplace_rshift*/
8978
 
  0, /*nb_inplace_and*/
8979
 
  0, /*nb_inplace_xor*/
8980
 
  0, /*nb_inplace_or*/
8981
 
  0, /*nb_floor_divide*/
8982
 
  0, /*nb_true_divide*/
8983
 
  0, /*nb_inplace_floor_divide*/
8984
 
  0, /*nb_inplace_true_divide*/
8985
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
8986
 
  0, /*nb_index*/
8987
 
  #endif
8988
 
};
8989
 
 
8990
 
static PySequenceMethods __pyx_tp_as_sequence_Context = {
8991
 
  0, /*sq_length*/
8992
 
  0, /*sq_concat*/
8993
 
  0, /*sq_repeat*/
8994
 
  0, /*sq_item*/
8995
 
  0, /*sq_slice*/
8996
 
  0, /*sq_ass_item*/
8997
 
  0, /*sq_ass_slice*/
8998
 
  0, /*sq_contains*/
8999
 
  0, /*sq_inplace_concat*/
9000
 
  0, /*sq_inplace_repeat*/
9001
 
};
9002
 
 
9003
 
static PyMappingMethods __pyx_tp_as_mapping_Context = {
9004
 
  0, /*mp_length*/
9005
 
  0, /*mp_subscript*/
9006
 
  0, /*mp_ass_subscript*/
9007
 
};
9008
 
 
9009
 
static PyBufferProcs __pyx_tp_as_buffer_Context = {
9010
 
  #if PY_MAJOR_VERSION < 3
9011
 
  0, /*bf_getreadbuffer*/
9012
 
  #endif
9013
 
  #if PY_MAJOR_VERSION < 3
9014
 
  0, /*bf_getwritebuffer*/
9015
 
  #endif
9016
 
  #if PY_MAJOR_VERSION < 3
9017
 
  0, /*bf_getsegcount*/
9018
 
  #endif
9019
 
  #if PY_MAJOR_VERSION < 3
9020
 
  0, /*bf_getcharbuffer*/
9021
 
  #endif
9022
 
  #if PY_VERSION_HEX >= 0x02060000
9023
 
  0, /*bf_getbuffer*/
9024
 
  #endif
9025
 
  #if PY_VERSION_HEX >= 0x02060000
9026
 
  0, /*bf_releasebuffer*/
9027
 
  #endif
9028
 
};
9029
 
 
9030
 
PyTypeObject __pyx_type_3zmq_4_zmq_Context = {
9031
 
  PyVarObject_HEAD_INIT(0, 0)
9032
 
  __Pyx_NAMESTR("zmq._zmq.Context"), /*tp_name*/
9033
 
  sizeof(struct __pyx_obj_3zmq_4_zmq_Context), /*tp_basicsize*/
9034
 
  0, /*tp_itemsize*/
9035
 
  __pyx_tp_dealloc_3zmq_4_zmq_Context, /*tp_dealloc*/
9036
 
  0, /*tp_print*/
9037
 
  0, /*tp_getattr*/
9038
 
  0, /*tp_setattr*/
9039
 
  0, /*tp_compare*/
9040
 
  0, /*tp_repr*/
9041
 
  &__pyx_tp_as_number_Context, /*tp_as_number*/
9042
 
  &__pyx_tp_as_sequence_Context, /*tp_as_sequence*/
9043
 
  &__pyx_tp_as_mapping_Context, /*tp_as_mapping*/
9044
 
  0, /*tp_hash*/
9045
 
  0, /*tp_call*/
9046
 
  0, /*tp_str*/
9047
 
  0, /*tp_getattro*/
9048
 
  0, /*tp_setattro*/
9049
 
  &__pyx_tp_as_buffer_Context, /*tp_as_buffer*/
9050
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
9051
 
  __Pyx_DOCSTR("Manage the lifecycle of a 0MQ context.\n\n    This class no longer takes any flags or the number of application\n    threads.\n\n    Parameters\n    ----------\n    io_threads : int\n        The number of IO threads.\n    "), /*tp_doc*/
9052
 
  0, /*tp_traverse*/
9053
 
  0, /*tp_clear*/
9054
 
  0, /*tp_richcompare*/
9055
 
  0, /*tp_weaklistoffset*/
9056
 
  0, /*tp_iter*/
9057
 
  0, /*tp_iternext*/
9058
 
  __pyx_methods_3zmq_4_zmq_Context, /*tp_methods*/
9059
 
  0, /*tp_members*/
9060
 
  0, /*tp_getset*/
9061
 
  0, /*tp_base*/
9062
 
  0, /*tp_dict*/
9063
 
  0, /*tp_descr_get*/
9064
 
  0, /*tp_descr_set*/
9065
 
  0, /*tp_dictoffset*/
9066
 
  0, /*tp_init*/
9067
 
  0, /*tp_alloc*/
9068
 
  __pyx_tp_new_3zmq_4_zmq_Context, /*tp_new*/
9069
 
  0, /*tp_free*/
9070
 
  0, /*tp_is_gc*/
9071
 
  0, /*tp_bases*/
9072
 
  0, /*tp_mro*/
9073
 
  0, /*tp_cache*/
9074
 
  0, /*tp_subclasses*/
9075
 
  0, /*tp_weaklist*/
9076
 
  0, /*tp_del*/
9077
 
  #if PY_VERSION_HEX >= 0x02060000
9078
 
  0, /*tp_version_tag*/
9079
 
  #endif
9080
 
};
9081
 
 
9082
 
static PyObject *__pyx_tp_new_3zmq_4_zmq_Socket(PyTypeObject *t, PyObject *a, PyObject *k) {
9083
 
  struct __pyx_obj_3zmq_4_zmq_Socket *p;
9084
 
  PyObject *o = (*t->tp_alloc)(t, 0);
9085
 
  if (!o) return 0;
9086
 
  p = ((struct __pyx_obj_3zmq_4_zmq_Socket *)o);
9087
 
  p->context = ((struct __pyx_obj_3zmq_4_zmq_Context *)Py_None); Py_INCREF(Py_None);
9088
 
  p->closed = Py_None; Py_INCREF(Py_None);
9089
 
  if (__pyx_pf_3zmq_4_zmq_6Socket___cinit__(o, a, k) < 0) {
9090
 
    Py_DECREF(o); o = 0;
9091
 
  }
9092
 
  return o;
9093
 
}
9094
 
 
9095
 
static void __pyx_tp_dealloc_3zmq_4_zmq_Socket(PyObject *o) {
9096
 
  struct __pyx_obj_3zmq_4_zmq_Socket *p = (struct __pyx_obj_3zmq_4_zmq_Socket *)o;
9097
 
  {
9098
 
    PyObject *etype, *eval, *etb;
9099
 
    PyErr_Fetch(&etype, &eval, &etb);
9100
 
    ++Py_REFCNT(o);
9101
 
    __pyx_pf_3zmq_4_zmq_6Socket___dealloc__(o);
9102
 
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
9103
 
    --Py_REFCNT(o);
9104
 
    PyErr_Restore(etype, eval, etb);
9105
 
  }
9106
 
  Py_XDECREF(((PyObject *)p->context));
9107
 
  Py_XDECREF(p->closed);
9108
 
  (*Py_TYPE(o)->tp_free)(o);
9109
 
}
9110
 
 
9111
 
static int __pyx_tp_traverse_3zmq_4_zmq_Socket(PyObject *o, visitproc v, void *a) {
9112
 
  int e;
9113
 
  struct __pyx_obj_3zmq_4_zmq_Socket *p = (struct __pyx_obj_3zmq_4_zmq_Socket *)o;
9114
 
  if (p->context) {
9115
 
    e = (*v)(((PyObject*)p->context), a); if (e) return e;
9116
 
  }
9117
 
  if (p->closed) {
9118
 
    e = (*v)(p->closed, a); if (e) return e;
9119
 
  }
9120
 
  return 0;
9121
 
}
9122
 
 
9123
 
static int __pyx_tp_clear_3zmq_4_zmq_Socket(PyObject *o) {
9124
 
  struct __pyx_obj_3zmq_4_zmq_Socket *p = (struct __pyx_obj_3zmq_4_zmq_Socket *)o;
9125
 
  PyObject* tmp;
9126
 
  tmp = ((PyObject*)p->context);
9127
 
  p->context = ((struct __pyx_obj_3zmq_4_zmq_Context *)Py_None); Py_INCREF(Py_None);
9128
 
  Py_XDECREF(tmp);
9129
 
  tmp = ((PyObject*)p->closed);
9130
 
  p->closed = Py_None; Py_INCREF(Py_None);
9131
 
  Py_XDECREF(tmp);
9132
 
  return 0;
9133
 
}
9134
 
 
9135
 
static PyObject *__pyx_getprop_3zmq_4_zmq_6Socket_context(PyObject *o, void *x) {
9136
 
  return __pyx_pf_3zmq_4_zmq_6Socket_7context___get__(o);
9137
 
}
9138
 
 
9139
 
static int __pyx_setprop_3zmq_4_zmq_6Socket_context(PyObject *o, PyObject *v, void *x) {
9140
 
  if (v) {
9141
 
    return __pyx_pf_3zmq_4_zmq_6Socket_7context___set__(o, v);
9142
 
  }
9143
 
  else {
9144
 
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
9145
 
    return -1;
9146
 
  }
9147
 
}
9148
 
 
9149
 
static struct PyMethodDef __pyx_methods_3zmq_4_zmq_Socket[] = {
9150
 
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_close)},
9151
 
  {__Pyx_NAMESTR("_check_closed"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket__check_closed, METH_NOARGS, __Pyx_DOCSTR(0)},
9152
 
  {__Pyx_NAMESTR("setsockopt"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_setsockopt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_setsockopt)},
9153
 
  {__Pyx_NAMESTR("getsockopt"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_getsockopt, METH_O, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_getsockopt)},
9154
 
  {__Pyx_NAMESTR("bind"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_bind, METH_O, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_bind)},
9155
 
  {__Pyx_NAMESTR("bind_to_random_port"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_bind_to_random_port, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_bind_to_random_port)},
9156
 
  {__Pyx_NAMESTR("connect"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_connect, METH_O, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_connect)},
9157
 
  {__Pyx_NAMESTR("send"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_send, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_send)},
9158
 
  {__Pyx_NAMESTR("_send_message"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket__send_message, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket__send_message)},
9159
 
  {__Pyx_NAMESTR("_send_copy"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket__send_copy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket__send_copy)},
9160
 
  {__Pyx_NAMESTR("_send_nocopy"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket__send_nocopy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket__send_nocopy)},
9161
 
  {__Pyx_NAMESTR("recv"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_recv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_recv)},
9162
 
  {__Pyx_NAMESTR("_recv_message"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket__recv_message, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket__recv_message)},
9163
 
  {__Pyx_NAMESTR("_recv_copy"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket__recv_copy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket__recv_copy)},
9164
 
  {__Pyx_NAMESTR("send_multipart"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_send_multipart, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_send_multipart)},
9165
 
  {__Pyx_NAMESTR("recv_multipart"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_recv_multipart, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_recv_multipart)},
9166
 
  {__Pyx_NAMESTR("rcvmore"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_rcvmore, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_rcvmore)},
9167
 
  {__Pyx_NAMESTR("send_pyobj"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_send_pyobj, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_send_pyobj)},
9168
 
  {__Pyx_NAMESTR("recv_pyobj"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_recv_pyobj, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_recv_pyobj)},
9169
 
  {__Pyx_NAMESTR("send_json"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_send_json, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_send_json)},
9170
 
  {__Pyx_NAMESTR("recv_json"), (PyCFunction)__pyx_pf_3zmq_4_zmq_6Socket_recv_json, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_6Socket_recv_json)},
9171
 
  {0, 0, 0, 0}
9172
 
};
9173
 
 
9174
 
static struct PyMemberDef __pyx_members_3zmq_4_zmq_Socket[] = {
9175
 
  {(char *)"socket_type", T_INT, offsetof(struct __pyx_obj_3zmq_4_zmq_Socket, socket_type), 0, 0},
9176
 
  {(char *)"closed", T_OBJECT, offsetof(struct __pyx_obj_3zmq_4_zmq_Socket, closed), 0, 0},
9177
 
  {0, 0, 0, 0, 0}
9178
 
};
9179
 
 
9180
 
static struct PyGetSetDef __pyx_getsets_3zmq_4_zmq_Socket[] = {
9181
 
  {(char *)"context", __pyx_getprop_3zmq_4_zmq_6Socket_context, __pyx_setprop_3zmq_4_zmq_6Socket_context, 0, 0},
9182
 
  {0, 0, 0, 0, 0}
9183
 
};
9184
 
 
9185
 
static PyNumberMethods __pyx_tp_as_number_Socket = {
9186
 
  0, /*nb_add*/
9187
 
  0, /*nb_subtract*/
9188
 
  0, /*nb_multiply*/
9189
 
  #if PY_MAJOR_VERSION < 3
9190
 
  0, /*nb_divide*/
9191
 
  #endif
9192
 
  0, /*nb_remainder*/
9193
 
  0, /*nb_divmod*/
9194
 
  0, /*nb_power*/
9195
 
  0, /*nb_negative*/
9196
 
  0, /*nb_positive*/
9197
 
  0, /*nb_absolute*/
9198
 
  0, /*nb_nonzero*/
9199
 
  0, /*nb_invert*/
9200
 
  0, /*nb_lshift*/
9201
 
  0, /*nb_rshift*/
9202
 
  0, /*nb_and*/
9203
 
  0, /*nb_xor*/
9204
 
  0, /*nb_or*/
9205
 
  #if PY_MAJOR_VERSION < 3
9206
 
  0, /*nb_coerce*/
9207
 
  #endif
9208
 
  0, /*nb_int*/
9209
 
  #if PY_MAJOR_VERSION >= 3
9210
 
  0, /*reserved*/
9211
 
  #else
9212
 
  0, /*nb_long*/
9213
 
  #endif
9214
 
  0, /*nb_float*/
9215
 
  #if PY_MAJOR_VERSION < 3
9216
 
  0, /*nb_oct*/
9217
 
  #endif
9218
 
  #if PY_MAJOR_VERSION < 3
9219
 
  0, /*nb_hex*/
9220
 
  #endif
9221
 
  0, /*nb_inplace_add*/
9222
 
  0, /*nb_inplace_subtract*/
9223
 
  0, /*nb_inplace_multiply*/
9224
 
  #if PY_MAJOR_VERSION < 3
9225
 
  0, /*nb_inplace_divide*/
9226
 
  #endif
9227
 
  0, /*nb_inplace_remainder*/
9228
 
  0, /*nb_inplace_power*/
9229
 
  0, /*nb_inplace_lshift*/
9230
 
  0, /*nb_inplace_rshift*/
9231
 
  0, /*nb_inplace_and*/
9232
 
  0, /*nb_inplace_xor*/
9233
 
  0, /*nb_inplace_or*/
9234
 
  0, /*nb_floor_divide*/
9235
 
  0, /*nb_true_divide*/
9236
 
  0, /*nb_inplace_floor_divide*/
9237
 
  0, /*nb_inplace_true_divide*/
9238
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
9239
 
  0, /*nb_index*/
9240
 
  #endif
9241
 
};
9242
 
 
9243
 
static PySequenceMethods __pyx_tp_as_sequence_Socket = {
9244
 
  0, /*sq_length*/
9245
 
  0, /*sq_concat*/
9246
 
  0, /*sq_repeat*/
9247
 
  0, /*sq_item*/
9248
 
  0, /*sq_slice*/
9249
 
  0, /*sq_ass_item*/
9250
 
  0, /*sq_ass_slice*/
9251
 
  0, /*sq_contains*/
9252
 
  0, /*sq_inplace_concat*/
9253
 
  0, /*sq_inplace_repeat*/
9254
 
};
9255
 
 
9256
 
static PyMappingMethods __pyx_tp_as_mapping_Socket = {
9257
 
  0, /*mp_length*/
9258
 
  0, /*mp_subscript*/
9259
 
  0, /*mp_ass_subscript*/
9260
 
};
9261
 
 
9262
 
static PyBufferProcs __pyx_tp_as_buffer_Socket = {
9263
 
  #if PY_MAJOR_VERSION < 3
9264
 
  0, /*bf_getreadbuffer*/
9265
 
  #endif
9266
 
  #if PY_MAJOR_VERSION < 3
9267
 
  0, /*bf_getwritebuffer*/
9268
 
  #endif
9269
 
  #if PY_MAJOR_VERSION < 3
9270
 
  0, /*bf_getsegcount*/
9271
 
  #endif
9272
 
  #if PY_MAJOR_VERSION < 3
9273
 
  0, /*bf_getcharbuffer*/
9274
 
  #endif
9275
 
  #if PY_VERSION_HEX >= 0x02060000
9276
 
  0, /*bf_getbuffer*/
9277
 
  #endif
9278
 
  #if PY_VERSION_HEX >= 0x02060000
9279
 
  0, /*bf_releasebuffer*/
9280
 
  #endif
9281
 
};
9282
 
 
9283
 
PyTypeObject __pyx_type_3zmq_4_zmq_Socket = {
9284
 
  PyVarObject_HEAD_INIT(0, 0)
9285
 
  __Pyx_NAMESTR("zmq._zmq.Socket"), /*tp_name*/
9286
 
  sizeof(struct __pyx_obj_3zmq_4_zmq_Socket), /*tp_basicsize*/
9287
 
  0, /*tp_itemsize*/
9288
 
  __pyx_tp_dealloc_3zmq_4_zmq_Socket, /*tp_dealloc*/
9289
 
  0, /*tp_print*/
9290
 
  0, /*tp_getattr*/
9291
 
  0, /*tp_setattr*/
9292
 
  0, /*tp_compare*/
9293
 
  0, /*tp_repr*/
9294
 
  &__pyx_tp_as_number_Socket, /*tp_as_number*/
9295
 
  &__pyx_tp_as_sequence_Socket, /*tp_as_sequence*/
9296
 
  &__pyx_tp_as_mapping_Socket, /*tp_as_mapping*/
9297
 
  0, /*tp_hash*/
9298
 
  0, /*tp_call*/
9299
 
  0, /*tp_str*/
9300
 
  0, /*tp_getattro*/
9301
 
  0, /*tp_setattro*/
9302
 
  &__pyx_tp_as_buffer_Socket, /*tp_as_buffer*/
9303
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
9304
 
  __Pyx_DOCSTR("A 0MQ socket.\n\n    Socket(context, socket_type)\n\n    Parameters\n    ----------\n    context : Context\n        The 0MQ Context this Socket belongs to.\n    socket_type : int\n        The socket type, which can be any of the 0MQ socket types: \n        REQ, REP, PUB, SUB, PAIR, XREQ, XREP, UPSTREAM, DOWNSTREAM.\n    "), /*tp_doc*/
9305
 
  __pyx_tp_traverse_3zmq_4_zmq_Socket, /*tp_traverse*/
9306
 
  __pyx_tp_clear_3zmq_4_zmq_Socket, /*tp_clear*/
9307
 
  0, /*tp_richcompare*/
9308
 
  0, /*tp_weaklistoffset*/
9309
 
  0, /*tp_iter*/
9310
 
  0, /*tp_iternext*/
9311
 
  __pyx_methods_3zmq_4_zmq_Socket, /*tp_methods*/
9312
 
  __pyx_members_3zmq_4_zmq_Socket, /*tp_members*/
9313
 
  __pyx_getsets_3zmq_4_zmq_Socket, /*tp_getset*/
9314
 
  0, /*tp_base*/
9315
 
  0, /*tp_dict*/
9316
 
  0, /*tp_descr_get*/
9317
 
  0, /*tp_descr_set*/
9318
 
  0, /*tp_dictoffset*/
9319
 
  0, /*tp_init*/
9320
 
  0, /*tp_alloc*/
9321
 
  __pyx_tp_new_3zmq_4_zmq_Socket, /*tp_new*/
9322
 
  0, /*tp_free*/
9323
 
  0, /*tp_is_gc*/
9324
 
  0, /*tp_bases*/
9325
 
  0, /*tp_mro*/
9326
 
  0, /*tp_cache*/
9327
 
  0, /*tp_subclasses*/
9328
 
  0, /*tp_weaklist*/
9329
 
  0, /*tp_del*/
9330
 
  #if PY_VERSION_HEX >= 0x02060000
9331
 
  0, /*tp_version_tag*/
9332
 
  #endif
9333
 
};
9334
 
 
9335
 
static struct PyMethodDef __pyx_methods[] = {
9336
 
  {__Pyx_NAMESTR("strerror"), (PyCFunction)__pyx_pf_3zmq_4_zmq_strerror, METH_O, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_strerror)},
9337
 
  {__Pyx_NAMESTR("_poll"), (PyCFunction)__pyx_pf_3zmq_4_zmq__poll, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq__poll)},
9338
 
  {__Pyx_NAMESTR("select"), (PyCFunction)__pyx_pf_3zmq_4_zmq_select, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_3zmq_4_zmq_select)},
9339
 
  {0, 0, 0, 0}
9340
 
};
9341
 
 
9342
 
static void __pyx_init_filenames(void); /*proto*/
9343
 
 
9344
 
#if PY_MAJOR_VERSION >= 3
9345
 
static struct PyModuleDef __pyx_moduledef = {
9346
 
    PyModuleDef_HEAD_INIT,
9347
 
    __Pyx_NAMESTR("_zmq"),
9348
 
    __Pyx_DOCSTR(__pyx_k_16), /* m_doc */
9349
 
    -1, /* m_size */
9350
 
    __pyx_methods /* m_methods */,
9351
 
    NULL, /* m_reload */
9352
 
    NULL, /* m_traverse */
9353
 
    NULL, /* m_clear */
9354
 
    NULL /* m_free */
9355
 
};
9356
 
#endif
9357
 
 
9358
 
static __Pyx_StringTabEntry __pyx_string_tab[] = {
9359
 
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
9360
 
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
9361
 
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
9362
 
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
9363
 
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
9364
 
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
9365
 
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
9366
 
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
9367
 
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
9368
 
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
9369
 
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
9370
 
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
9371
 
  {&__pyx_n_s__AFFINITY, __pyx_k__AFFINITY, sizeof(__pyx_k__AFFINITY), 0, 0, 1, 1},
9372
 
  {&__pyx_n_s__Context, __pyx_k__Context, sizeof(__pyx_k__Context), 0, 0, 1, 1},
9373
 
  {&__pyx_n_s__DOWNSTREAM, __pyx_k__DOWNSTREAM, sizeof(__pyx_k__DOWNSTREAM), 0, 0, 1, 1},
9374
 
  {&__pyx_n_s__EADDRINUSE, __pyx_k__EADDRINUSE, sizeof(__pyx_k__EADDRINUSE), 0, 0, 1, 1},
9375
 
  {&__pyx_n_s__EADDRNOTAVAIL, __pyx_k__EADDRNOTAVAIL, sizeof(__pyx_k__EADDRNOTAVAIL), 0, 0, 1, 1},
9376
 
  {&__pyx_n_s__EAGAIN, __pyx_k__EAGAIN, sizeof(__pyx_k__EAGAIN), 0, 0, 1, 1},
9377
 
  {&__pyx_n_s__ECONNREFUSED, __pyx_k__ECONNREFUSED, sizeof(__pyx_k__ECONNREFUSED), 0, 0, 1, 1},
9378
 
  {&__pyx_n_s__EFSM, __pyx_k__EFSM, sizeof(__pyx_k__EFSM), 0, 0, 1, 1},
9379
 
  {&__pyx_n_s__EINPROGRESS, __pyx_k__EINPROGRESS, sizeof(__pyx_k__EINPROGRESS), 0, 0, 1, 1},
9380
 
  {&__pyx_n_s__EINVAL, __pyx_k__EINVAL, sizeof(__pyx_k__EINVAL), 0, 0, 1, 1},
9381
 
  {&__pyx_n_s__EMTHREAD, __pyx_k__EMTHREAD, sizeof(__pyx_k__EMTHREAD), 0, 0, 1, 1},
9382
 
  {&__pyx_n_s__ENETDOWN, __pyx_k__ENETDOWN, sizeof(__pyx_k__ENETDOWN), 0, 0, 1, 1},
9383
 
  {&__pyx_n_s__ENOBUFS, __pyx_k__ENOBUFS, sizeof(__pyx_k__ENOBUFS), 0, 0, 1, 1},
9384
 
  {&__pyx_n_s__ENOCOMPATPROTO, __pyx_k__ENOCOMPATPROTO, sizeof(__pyx_k__ENOCOMPATPROTO), 0, 0, 1, 1},
9385
 
  {&__pyx_n_s__ENOTSUP, __pyx_k__ENOTSUP, sizeof(__pyx_k__ENOTSUP), 0, 0, 1, 1},
9386
 
  {&__pyx_n_s__EPROTONOSUPPORT, __pyx_k__EPROTONOSUPPORT, sizeof(__pyx_k__EPROTONOSUPPORT), 0, 0, 1, 1},
9387
 
  {&__pyx_n_s__ETERM, __pyx_k__ETERM, sizeof(__pyx_k__ETERM), 0, 0, 1, 1},
9388
 
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
9389
 
  {&__pyx_n_s__HWM, __pyx_k__HWM, sizeof(__pyx_k__HWM), 0, 0, 1, 1},
9390
 
  {&__pyx_n_s__IDENTITY, __pyx_k__IDENTITY, sizeof(__pyx_k__IDENTITY), 0, 0, 1, 1},
9391
 
  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
9392
 
  {&__pyx_n_s__MCAST_LOOP, __pyx_k__MCAST_LOOP, sizeof(__pyx_k__MCAST_LOOP), 0, 0, 1, 1},
9393
 
  {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
9394
 
  {&__pyx_n_s__Message, __pyx_k__Message, sizeof(__pyx_k__Message), 0, 0, 1, 1},
9395
 
  {&__pyx_n_s__NOBLOCK, __pyx_k__NOBLOCK, sizeof(__pyx_k__NOBLOCK), 0, 0, 1, 1},
9396
 
  {&__pyx_n_s__PAIR, __pyx_k__PAIR, sizeof(__pyx_k__PAIR), 0, 0, 1, 1},
9397
 
  {&__pyx_n_s__POLLERR, __pyx_k__POLLERR, sizeof(__pyx_k__POLLERR), 0, 0, 1, 1},
9398
 
  {&__pyx_n_s__POLLIN, __pyx_k__POLLIN, sizeof(__pyx_k__POLLIN), 0, 0, 1, 1},
9399
 
  {&__pyx_n_s__POLLOUT, __pyx_k__POLLOUT, sizeof(__pyx_k__POLLOUT), 0, 0, 1, 1},
9400
 
  {&__pyx_n_s__PUB, __pyx_k__PUB, sizeof(__pyx_k__PUB), 0, 0, 1, 1},
9401
 
  {&__pyx_n_s__Poller, __pyx_k__Poller, sizeof(__pyx_k__Poller), 0, 0, 1, 1},
9402
 
  {&__pyx_n_s__RATE, __pyx_k__RATE, sizeof(__pyx_k__RATE), 0, 0, 1, 1},
9403
 
  {&__pyx_n_s__RCVBUF, __pyx_k__RCVBUF, sizeof(__pyx_k__RCVBUF), 0, 0, 1, 1},
9404
 
  {&__pyx_n_s__RCVMORE, __pyx_k__RCVMORE, sizeof(__pyx_k__RCVMORE), 0, 0, 1, 1},
9405
 
  {&__pyx_n_s__RECOVERY_IVL, __pyx_k__RECOVERY_IVL, sizeof(__pyx_k__RECOVERY_IVL), 0, 0, 1, 1},
9406
 
  {&__pyx_n_s__REP, __pyx_k__REP, sizeof(__pyx_k__REP), 0, 0, 1, 1},
9407
 
  {&__pyx_n_s__REQ, __pyx_k__REQ, sizeof(__pyx_k__REQ), 0, 0, 1, 1},
9408
 
  {&__pyx_n_s__SNDBUF, __pyx_k__SNDBUF, sizeof(__pyx_k__SNDBUF), 0, 0, 1, 1},
9409
 
  {&__pyx_n_s__SNDMORE, __pyx_k__SNDMORE, sizeof(__pyx_k__SNDMORE), 0, 0, 1, 1},
9410
 
  {&__pyx_n_s__SUB, __pyx_k__SUB, sizeof(__pyx_k__SUB), 0, 0, 1, 1},
9411
 
  {&__pyx_n_s__SUBSCRIBE, __pyx_k__SUBSCRIBE, sizeof(__pyx_k__SUBSCRIBE), 0, 0, 1, 1},
9412
 
  {&__pyx_n_s__SWAP, __pyx_k__SWAP, sizeof(__pyx_k__SWAP), 0, 0, 1, 1},
9413
 
  {&__pyx_n_s__Socket, __pyx_k__Socket, sizeof(__pyx_k__Socket), 0, 0, 1, 1},
9414
 
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
9415
 
  {&__pyx_n_s__UNSUBSCRIBE, __pyx_k__UNSUBSCRIBE, sizeof(__pyx_k__UNSUBSCRIBE), 0, 0, 1, 1},
9416
 
  {&__pyx_n_s__UPSTREAM, __pyx_k__UPSTREAM, sizeof(__pyx_k__UPSTREAM), 0, 0, 1, 1},
9417
 
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
9418
 
  {&__pyx_n_s__XREP, __pyx_k__XREP, sizeof(__pyx_k__XREP), 0, 0, 1, 1},
9419
 
  {&__pyx_n_s__XREQ, __pyx_k__XREQ, sizeof(__pyx_k__XREQ), 0, 0, 1, 1},
9420
 
  {&__pyx_n_s__ZMQBaseError, __pyx_k__ZMQBaseError, sizeof(__pyx_k__ZMQBaseError), 0, 0, 1, 1},
9421
 
  {&__pyx_n_s__ZMQBindError, __pyx_k__ZMQBindError, sizeof(__pyx_k__ZMQBindError), 0, 0, 1, 1},
9422
 
  {&__pyx_n_s__ZMQError, __pyx_k__ZMQError, sizeof(__pyx_k__ZMQError), 0, 0, 1, 1},
9423
 
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
9424
 
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
9425
 
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
9426
 
  {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1},
9427
 
  {&__pyx_n_s___check_closed, __pyx_k___check_closed, sizeof(__pyx_k___check_closed), 0, 0, 1, 1},
9428
 
  {&__pyx_n_s___poll, __pyx_k___poll, sizeof(__pyx_k___poll), 0, 0, 1, 1},
9429
 
  {&__pyx_n_s___recv_copy, __pyx_k___recv_copy, sizeof(__pyx_k___recv_copy), 0, 0, 1, 1},
9430
 
  {&__pyx_n_s___recv_message, __pyx_k___recv_message, sizeof(__pyx_k___recv_message), 0, 0, 1, 1},
9431
 
  {&__pyx_n_s___send_copy, __pyx_k___send_copy, sizeof(__pyx_k___send_copy), 0, 0, 1, 1},
9432
 
  {&__pyx_n_s___send_message, __pyx_k___send_message, sizeof(__pyx_k___send_message), 0, 0, 1, 1},
9433
 
  {&__pyx_n_s__addr, __pyx_k__addr, sizeof(__pyx_k__addr), 0, 0, 1, 1},
9434
 
  {&__pyx_n_s__bind, __pyx_k__bind, sizeof(__pyx_k__bind), 0, 0, 1, 1},
9435
 
  {&__pyx_n_s__cPickle, __pyx_k__cPickle, sizeof(__pyx_k__cPickle), 0, 0, 1, 1},
9436
 
  {&__pyx_n_s__close, __pyx_k__close, sizeof(__pyx_k__close), 0, 0, 1, 1},
9437
 
  {&__pyx_n_s__closed, __pyx_k__closed, sizeof(__pyx_k__closed), 0, 0, 1, 1},
9438
 
  {&__pyx_n_s__context, __pyx_k__context, sizeof(__pyx_k__context), 0, 0, 1, 1},
9439
 
  {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
9440
 
  {&__pyx_n_s__copy_mod, __pyx_k__copy_mod, sizeof(__pyx_k__copy_mod), 0, 0, 1, 1},
9441
 
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
9442
 
  {&__pyx_n_s__dumps, __pyx_k__dumps, sizeof(__pyx_k__dumps), 0, 0, 1, 1},
9443
 
  {&__pyx_n_s__errno, __pyx_k__errno, sizeof(__pyx_k__errno), 0, 0, 1, 1},
9444
 
  {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
9445
 
  {&__pyx_n_s__errstr, __pyx_k__errstr, sizeof(__pyx_k__errstr), 0, 0, 1, 1},
9446
 
  {&__pyx_n_s__events, __pyx_k__events, sizeof(__pyx_k__events), 0, 0, 1, 1},
9447
 
  {&__pyx_n_s__fast_copy, __pyx_k__fast_copy, sizeof(__pyx_k__fast_copy), 0, 0, 1, 1},
9448
 
  {&__pyx_n_s__fd, __pyx_k__fd, sizeof(__pyx_k__fd), 0, 0, 1, 1},
9449
 
  {&__pyx_n_s__fileno, __pyx_k__fileno, sizeof(__pyx_k__fileno), 0, 0, 1, 1},
9450
 
  {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
9451
 
  {&__pyx_n_s__getsockopt, __pyx_k__getsockopt, sizeof(__pyx_k__getsockopt), 0, 0, 1, 1},
9452
 
  {&__pyx_n_s__handle, __pyx_k__handle, sizeof(__pyx_k__handle), 0, 0, 1, 1},
9453
 
  {&__pyx_n_s__io_threads, __pyx_k__io_threads, sizeof(__pyx_k__io_threads), 0, 0, 1, 1},
9454
 
  {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1},
9455
 
  {&__pyx_n_s__json, __pyx_k__json, sizeof(__pyx_k__json), 0, 0, 1, 1},
9456
 
  {&__pyx_n_s__loads, __pyx_k__loads, sizeof(__pyx_k__loads), 0, 0, 1, 1},
9457
 
  {&__pyx_n_s__max_port, __pyx_k__max_port, sizeof(__pyx_k__max_port), 0, 0, 1, 1},
9458
 
  {&__pyx_n_s__max_tries, __pyx_k__max_tries, sizeof(__pyx_k__max_tries), 0, 0, 1, 1},
9459
 
  {&__pyx_n_s__min_port, __pyx_k__min_port, sizeof(__pyx_k__min_port), 0, 0, 1, 1},
9460
 
  {&__pyx_n_s__modify, __pyx_k__modify, sizeof(__pyx_k__modify), 0, 0, 1, 1},
9461
 
  {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
9462
 
  {&__pyx_n_s__msg_parts, __pyx_k__msg_parts, sizeof(__pyx_k__msg_parts), 0, 0, 1, 1},
9463
 
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
9464
 
  {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1},
9465
 
  {&__pyx_n_s__option, __pyx_k__option, sizeof(__pyx_k__option), 0, 0, 1, 1},
9466
 
  {&__pyx_n_s__optval, __pyx_k__optval, sizeof(__pyx_k__optval), 0, 0, 1, 1},
9467
 
  {&__pyx_n_s__pickle, __pyx_k__pickle, sizeof(__pyx_k__pickle), 0, 0, 1, 1},
9468
 
  {&__pyx_n_s__poll, __pyx_k__poll, sizeof(__pyx_k__poll), 0, 0, 1, 1},
9469
 
  {&__pyx_n_s__protocol, __pyx_k__protocol, sizeof(__pyx_k__protocol), 0, 0, 1, 1},
9470
 
  {&__pyx_n_s__random, __pyx_k__random, sizeof(__pyx_k__random), 0, 0, 1, 1},
9471
 
  {&__pyx_n_s__randrange, __pyx_k__randrange, sizeof(__pyx_k__randrange), 0, 0, 1, 1},
9472
 
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
9473
 
  {&__pyx_n_s__rcvmore, __pyx_k__rcvmore, sizeof(__pyx_k__rcvmore), 0, 0, 1, 1},
9474
 
  {&__pyx_n_s__recv, __pyx_k__recv, sizeof(__pyx_k__recv), 0, 0, 1, 1},
9475
 
  {&__pyx_n_s__register, __pyx_k__register, sizeof(__pyx_k__register), 0, 0, 1, 1},
9476
 
  {&__pyx_n_s__revents, __pyx_k__revents, sizeof(__pyx_k__revents), 0, 0, 1, 1},
9477
 
  {&__pyx_n_s__rlist, __pyx_k__rlist, sizeof(__pyx_k__rlist), 0, 0, 1, 1},
9478
 
  {&__pyx_n_s__select, __pyx_k__select, sizeof(__pyx_k__select), 0, 0, 1, 1},
9479
 
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
9480
 
  {&__pyx_n_s__send, __pyx_k__send, sizeof(__pyx_k__send), 0, 0, 1, 1},
9481
 
  {&__pyx_n_s__separators, __pyx_k__separators, sizeof(__pyx_k__separators), 0, 0, 1, 1},
9482
 
  {&__pyx_n_s__simplejson, __pyx_k__simplejson, sizeof(__pyx_k__simplejson), 0, 0, 1, 1},
9483
 
  {&__pyx_n_s__socket, __pyx_k__socket, sizeof(__pyx_k__socket), 0, 0, 1, 1},
9484
 
  {&__pyx_n_s__socket_type, __pyx_k__socket_type, sizeof(__pyx_k__socket_type), 0, 0, 1, 1},
9485
 
  {&__pyx_n_s__sockets, __pyx_k__sockets, sizeof(__pyx_k__sockets), 0, 0, 1, 1},
9486
 
  {&__pyx_n_s__strerror, __pyx_k__strerror, sizeof(__pyx_k__strerror), 0, 0, 1, 1},
9487
 
  {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
9488
 
  {&__pyx_n_s__timeout, __pyx_k__timeout, sizeof(__pyx_k__timeout), 0, 0, 1, 1},
9489
 
  {&__pyx_n_s__unregister, __pyx_k__unregister, sizeof(__pyx_k__unregister), 0, 0, 1, 1},
9490
 
  {&__pyx_n_s__wlist, __pyx_k__wlist, sizeof(__pyx_k__wlist), 0, 0, 1, 1},
9491
 
  {&__pyx_n_s__xlist, __pyx_k__xlist, sizeof(__pyx_k__xlist), 0, 0, 1, 1},
9492
 
  {&__pyx_n_s__zmq_msg, __pyx_k__zmq_msg, sizeof(__pyx_k__zmq_msg), 0, 0, 1, 1},
9493
 
  {0, 0, 0, 0, 0, 0, 0}
9494
 
};
9495
 
static int __Pyx_InitCachedBuiltins(void) {
9496
 
  __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9497
 
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9498
 
  __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9499
 
  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9500
 
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9501
 
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9502
 
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9503
 
  return 0;
9504
 
  __pyx_L1_error:;
9505
 
  return -1;
9506
 
}
9507
 
 
9508
 
static int __Pyx_InitGlobals(void) {
9509
 
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9510
 
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9511
 
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9512
 
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9513
 
  __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9514
 
  __pyx_int_20000 = PyInt_FromLong(20000); if (unlikely(!__pyx_int_20000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9515
 
  return 0;
9516
 
  __pyx_L1_error:;
9517
 
  return -1;
9518
 
}
9519
 
 
9520
 
#if PY_MAJOR_VERSION < 3
9521
 
PyMODINIT_FUNC init_zmq(void); /*proto*/
9522
 
PyMODINIT_FUNC init_zmq(void)
9523
 
#else
9524
 
PyMODINIT_FUNC PyInit__zmq(void); /*proto*/
9525
 
PyMODINIT_FUNC PyInit__zmq(void)
9526
 
#endif
9527
 
{
9528
 
  PyObject *__pyx_t_1 = NULL;
9529
 
  int __pyx_t_2;
9530
 
  PyObject *__pyx_t_3 = NULL;
9531
 
  PyObject *__pyx_t_4 = NULL;
9532
 
  PyObject *__pyx_t_5 = NULL;
9533
 
  PyObject *__pyx_t_6 = NULL;
9534
 
  PyObject *__pyx_t_7 = NULL;
9535
 
  #if CYTHON_REFNANNY
9536
 
  void* __pyx_refnanny = NULL;
9537
 
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9538
 
  if (!__Pyx_RefNanny) {
9539
 
      PyErr_Clear();
9540
 
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9541
 
      if (!__Pyx_RefNanny)
9542
 
          Py_FatalError("failed to import 'refnanny' module");
9543
 
  }
9544
 
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__zmq(void)", __LINE__, __FILE__);
9545
 
  #endif
9546
 
  __pyx_init_filenames();
9547
 
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9548
 
  #if PY_MAJOR_VERSION < 3
9549
 
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9550
 
  #else
9551
 
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9552
 
  #endif
9553
 
  /*--- Library function declarations ---*/
9554
 
  /*--- Threads initialization code ---*/
9555
 
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
9556
 
  #ifdef WITH_THREAD /* Python build with threading support? */
9557
 
  PyEval_InitThreads();
9558
 
  #endif
9559
 
  #endif
9560
 
  /*--- Module creation code ---*/
9561
 
  #if PY_MAJOR_VERSION < 3
9562
 
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_zmq"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_16), 0, PYTHON_API_VERSION);
9563
 
  #else
9564
 
  __pyx_m = PyModule_Create(&__pyx_moduledef);
9565
 
  #endif
9566
 
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9567
 
  #if PY_MAJOR_VERSION < 3
9568
 
  Py_INCREF(__pyx_m);
9569
 
  #endif
9570
 
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
9571
 
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9572
 
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9573
 
  /*--- Initialize various global constants etc. ---*/
9574
 
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9575
 
  if (__pyx_module_is_main_zmq___zmq) {
9576
 
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
9577
 
  }
9578
 
  /*--- Builtin init code ---*/
9579
 
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9580
 
  /*--- Global init code ---*/
9581
 
  /*--- Function export code ---*/
9582
 
  /*--- Type init code ---*/
9583
 
  __pyx_vtabptr_3zmq_4_zmq_Message = &__pyx_vtable_3zmq_4_zmq_Message;
9584
 
  #if PY_MAJOR_VERSION >= 3
9585
 
  __pyx_vtable_3zmq_4_zmq_Message.fast_copy = (struct __pyx_obj_3zmq_4_zmq_Message *(*)(struct __pyx_obj_3zmq_4_zmq_Message *))__pyx_f_3zmq_4_zmq_7Message_fast_copy;
9586
 
  #else
9587
 
  *(void(**)(void))&__pyx_vtable_3zmq_4_zmq_Message.fast_copy = (void(*)(void))__pyx_f_3zmq_4_zmq_7Message_fast_copy;
9588
 
  #endif
9589
 
  if (PyType_Ready(&__pyx_type_3zmq_4_zmq_Message) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9590
 
  if (__Pyx_SetVtable(__pyx_type_3zmq_4_zmq_Message.tp_dict, __pyx_vtabptr_3zmq_4_zmq_Message) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9591
 
  if (__Pyx_SetAttrString(__pyx_m, "Message", (PyObject *)&__pyx_type_3zmq_4_zmq_Message) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9592
 
  __pyx_ptype_3zmq_4_zmq_Message = &__pyx_type_3zmq_4_zmq_Message;
9593
 
  if (PyType_Ready(&__pyx_type_3zmq_4_zmq_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9594
 
  if (__Pyx_SetAttrString(__pyx_m, "Context", (PyObject *)&__pyx_type_3zmq_4_zmq_Context) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9595
 
  __pyx_ptype_3zmq_4_zmq_Context = &__pyx_type_3zmq_4_zmq_Context;
9596
 
  if (PyType_Ready(&__pyx_type_3zmq_4_zmq_Socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9597
 
  if (__Pyx_SetAttrString(__pyx_m, "Socket", (PyObject *)&__pyx_type_3zmq_4_zmq_Socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9598
 
  __pyx_ptype_3zmq_4_zmq_Socket = &__pyx_type_3zmq_4_zmq_Socket;
9599
 
  /*--- Type import code ---*/
9600
 
  /*--- Function import code ---*/
9601
 
  /*--- Execution code ---*/
9602
 
 
9603
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":39
9604
 
 * # For some reason we need to call this.  My guess is that we are not doing
9605
 
 * # any Python treading.
9606
 
 * PyEval_InitThreads()             # <<<<<<<<<<<<<<
9607
 
 * 
9608
 
 * import copy as copy_mod
9609
 
 */
9610
 
  PyEval_InitThreads();
9611
 
 
9612
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":41
9613
 
 * PyEval_InitThreads()
9614
 
 * 
9615
 
 * import copy as copy_mod             # <<<<<<<<<<<<<<
9616
 
 * import cPickle as pickle
9617
 
 * import random
9618
 
 */
9619
 
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__copy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9620
 
  __Pyx_GOTREF(__pyx_t_1);
9621
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__copy_mod, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9622
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9623
 
 
9624
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":42
9625
 
 * 
9626
 
 * import copy as copy_mod
9627
 
 * import cPickle as pickle             # <<<<<<<<<<<<<<
9628
 
 * import random
9629
 
 * import struct
9630
 
 */
9631
 
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__cPickle), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9632
 
  __Pyx_GOTREF(__pyx_t_1);
9633
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pickle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9634
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9635
 
 
9636
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":43
9637
 
 * import copy as copy_mod
9638
 
 * import cPickle as pickle
9639
 
 * import random             # <<<<<<<<<<<<<<
9640
 
 * import struct
9641
 
 * 
9642
 
 */
9643
 
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__random), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9644
 
  __Pyx_GOTREF(__pyx_t_1);
9645
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9646
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9647
 
 
9648
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":44
9649
 
 * import cPickle as pickle
9650
 
 * import random
9651
 
 * import struct             # <<<<<<<<<<<<<<
9652
 
 * 
9653
 
 * try:
9654
 
 */
9655
 
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9656
 
  __Pyx_GOTREF(__pyx_t_1);
9657
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9658
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9659
 
 
9660
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":46
9661
 
 * import struct
9662
 
 * 
9663
 
 * try:             # <<<<<<<<<<<<<<
9664
 
 *     import json
9665
 
 * except ImportError:
9666
 
 */
9667
 
  {
9668
 
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
9669
 
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
9670
 
    __Pyx_XGOTREF(__pyx_save_exc_type);
9671
 
    __Pyx_XGOTREF(__pyx_save_exc_value);
9672
 
    __Pyx_XGOTREF(__pyx_save_exc_tb);
9673
 
    /*try:*/ {
9674
 
 
9675
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":47
9676
 
 * 
9677
 
 * try:
9678
 
 *     import json             # <<<<<<<<<<<<<<
9679
 
 * except ImportError:
9680
 
 *     try:
9681
 
 */
9682
 
      __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__json), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
9683
 
      __Pyx_GOTREF(__pyx_t_1);
9684
 
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__json, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
9685
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9686
 
    }
9687
 
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
9688
 
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
9689
 
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
9690
 
    goto __pyx_L9_try_end;
9691
 
    __pyx_L2_error:;
9692
 
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9693
 
 
9694
 
    /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":48
9695
 
 * try:
9696
 
 *     import json
9697
 
 * except ImportError:             # <<<<<<<<<<<<<<
9698
 
 *     try:
9699
 
 *         import simplejson as json
9700
 
 */
9701
 
    __pyx_t_2 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
9702
 
    if (__pyx_t_2) {
9703
 
      __Pyx_AddTraceback("zmq._zmq");
9704
 
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
9705
 
      __Pyx_GOTREF(__pyx_t_1);
9706
 
      __Pyx_GOTREF(__pyx_t_3);
9707
 
      __Pyx_GOTREF(__pyx_t_4);
9708
 
 
9709
 
      /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":49
9710
 
 *     import json
9711
 
 * except ImportError:
9712
 
 *     try:             # <<<<<<<<<<<<<<
9713
 
 *         import simplejson as json
9714
 
 *     except ImportError:
9715
 
 */
9716
 
      {
9717
 
        PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
9718
 
        __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
9719
 
        __Pyx_XGOTREF(__pyx_save_exc_type);
9720
 
        __Pyx_XGOTREF(__pyx_save_exc_value);
9721
 
        __Pyx_XGOTREF(__pyx_save_exc_tb);
9722
 
        /*try:*/ {
9723
 
 
9724
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":50
9725
 
 * except ImportError:
9726
 
 *     try:
9727
 
 *         import simplejson as json             # <<<<<<<<<<<<<<
9728
 
 *     except ImportError:
9729
 
 *         json = None
9730
 
 */
9731
 
          __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s__simplejson), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
9732
 
          __Pyx_GOTREF(__pyx_t_5);
9733
 
          if (PyObject_SetAttr(__pyx_m, __pyx_n_s__json, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
9734
 
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9735
 
        }
9736
 
        __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
9737
 
        __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
9738
 
        __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
9739
 
        goto __pyx_L19_try_end;
9740
 
        __pyx_L12_error:;
9741
 
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9742
 
 
9743
 
        /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":51
9744
 
 *     try:
9745
 
 *         import simplejson as json
9746
 
 *     except ImportError:             # <<<<<<<<<<<<<<
9747
 
 *         json = None
9748
 
 * 
9749
 
 */
9750
 
        __pyx_t_2 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
9751
 
        if (__pyx_t_2) {
9752
 
          __Pyx_AddTraceback("zmq._zmq");
9753
 
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
9754
 
          __Pyx_GOTREF(__pyx_t_5);
9755
 
          __Pyx_GOTREF(__pyx_t_6);
9756
 
          __Pyx_GOTREF(__pyx_t_7);
9757
 
 
9758
 
          /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":52
9759
 
 *         import simplejson as json
9760
 
 *     except ImportError:
9761
 
 *         json = None             # <<<<<<<<<<<<<<
9762
 
 * 
9763
 
 * include "allocate.pxi"
9764
 
 */
9765
 
          if (PyObject_SetAttr(__pyx_m, __pyx_n_s__json, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
9766
 
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9767
 
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9768
 
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9769
 
          goto __pyx_L13_exception_handled;
9770
 
        }
9771
 
        __pyx_L14_except_error:;
9772
 
        __Pyx_XGIVEREF(__pyx_save_exc_type);
9773
 
        __Pyx_XGIVEREF(__pyx_save_exc_value);
9774
 
        __Pyx_XGIVEREF(__pyx_save_exc_tb);
9775
 
        __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
9776
 
        goto __pyx_L4_except_error;
9777
 
        __pyx_L13_exception_handled:;
9778
 
        __Pyx_XGIVEREF(__pyx_save_exc_type);
9779
 
        __Pyx_XGIVEREF(__pyx_save_exc_value);
9780
 
        __Pyx_XGIVEREF(__pyx_save_exc_tb);
9781
 
        __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
9782
 
        __pyx_L19_try_end:;
9783
 
      }
9784
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9785
 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9786
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9787
 
      goto __pyx_L3_exception_handled;
9788
 
    }
9789
 
    __pyx_L4_except_error:;
9790
 
    __Pyx_XGIVEREF(__pyx_save_exc_type);
9791
 
    __Pyx_XGIVEREF(__pyx_save_exc_value);
9792
 
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
9793
 
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
9794
 
    goto __pyx_L1_error;
9795
 
    __pyx_L3_exception_handled:;
9796
 
    __Pyx_XGIVEREF(__pyx_save_exc_type);
9797
 
    __Pyx_XGIVEREF(__pyx_save_exc_value);
9798
 
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
9799
 
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
9800
 
    __pyx_L9_try_end:;
9801
 
  }
9802
 
 
9803
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":172
9804
 
 * #-----------------------------------------------------------------------------
9805
 
 * 
9806
 
 * NOBLOCK = ZMQ_NOBLOCK             # <<<<<<<<<<<<<<
9807
 
 * PAIR = ZMQ_PAIR
9808
 
 * PUB = ZMQ_PUB
9809
 
 */
9810
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_NOBLOCK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9811
 
  __Pyx_GOTREF(__pyx_t_4);
9812
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NOBLOCK, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9813
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9814
 
 
9815
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":173
9816
 
 * 
9817
 
 * NOBLOCK = ZMQ_NOBLOCK
9818
 
 * PAIR = ZMQ_PAIR             # <<<<<<<<<<<<<<
9819
 
 * PUB = ZMQ_PUB
9820
 
 * SUB = ZMQ_SUB
9821
 
 */
9822
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_PAIR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9823
 
  __Pyx_GOTREF(__pyx_t_4);
9824
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PAIR, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9825
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9826
 
 
9827
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":174
9828
 
 * NOBLOCK = ZMQ_NOBLOCK
9829
 
 * PAIR = ZMQ_PAIR
9830
 
 * PUB = ZMQ_PUB             # <<<<<<<<<<<<<<
9831
 
 * SUB = ZMQ_SUB
9832
 
 * REQ = ZMQ_REQ
9833
 
 */
9834
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_PUB); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9835
 
  __Pyx_GOTREF(__pyx_t_4);
9836
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PUB, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9837
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9838
 
 
9839
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":175
9840
 
 * PAIR = ZMQ_PAIR
9841
 
 * PUB = ZMQ_PUB
9842
 
 * SUB = ZMQ_SUB             # <<<<<<<<<<<<<<
9843
 
 * REQ = ZMQ_REQ
9844
 
 * REP = ZMQ_REP
9845
 
 */
9846
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_SUB); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9847
 
  __Pyx_GOTREF(__pyx_t_4);
9848
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SUB, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9849
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9850
 
 
9851
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":176
9852
 
 * PUB = ZMQ_PUB
9853
 
 * SUB = ZMQ_SUB
9854
 
 * REQ = ZMQ_REQ             # <<<<<<<<<<<<<<
9855
 
 * REP = ZMQ_REP
9856
 
 * XREQ = ZMQ_XREQ
9857
 
 */
9858
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_REQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9859
 
  __Pyx_GOTREF(__pyx_t_4);
9860
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__REQ, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9861
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9862
 
 
9863
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":177
9864
 
 * SUB = ZMQ_SUB
9865
 
 * REQ = ZMQ_REQ
9866
 
 * REP = ZMQ_REP             # <<<<<<<<<<<<<<
9867
 
 * XREQ = ZMQ_XREQ
9868
 
 * XREP = ZMQ_XREP
9869
 
 */
9870
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_REP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9871
 
  __Pyx_GOTREF(__pyx_t_4);
9872
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__REP, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9873
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9874
 
 
9875
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":178
9876
 
 * REQ = ZMQ_REQ
9877
 
 * REP = ZMQ_REP
9878
 
 * XREQ = ZMQ_XREQ             # <<<<<<<<<<<<<<
9879
 
 * XREP = ZMQ_XREP
9880
 
 * UPSTREAM = ZMQ_UPSTREAM
9881
 
 */
9882
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_XREQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9883
 
  __Pyx_GOTREF(__pyx_t_4);
9884
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__XREQ, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9885
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9886
 
 
9887
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":179
9888
 
 * REP = ZMQ_REP
9889
 
 * XREQ = ZMQ_XREQ
9890
 
 * XREP = ZMQ_XREP             # <<<<<<<<<<<<<<
9891
 
 * UPSTREAM = ZMQ_UPSTREAM
9892
 
 * DOWNSTREAM = ZMQ_DOWNSTREAM
9893
 
 */
9894
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_XREP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9895
 
  __Pyx_GOTREF(__pyx_t_4);
9896
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__XREP, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9897
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9898
 
 
9899
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":180
9900
 
 * XREQ = ZMQ_XREQ
9901
 
 * XREP = ZMQ_XREP
9902
 
 * UPSTREAM = ZMQ_UPSTREAM             # <<<<<<<<<<<<<<
9903
 
 * DOWNSTREAM = ZMQ_DOWNSTREAM
9904
 
 * HWM = ZMQ_HWM
9905
 
 */
9906
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_UPSTREAM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9907
 
  __Pyx_GOTREF(__pyx_t_4);
9908
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UPSTREAM, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9909
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9910
 
 
9911
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":181
9912
 
 * XREP = ZMQ_XREP
9913
 
 * UPSTREAM = ZMQ_UPSTREAM
9914
 
 * DOWNSTREAM = ZMQ_DOWNSTREAM             # <<<<<<<<<<<<<<
9915
 
 * HWM = ZMQ_HWM
9916
 
 * SWAP = ZMQ_SWAP
9917
 
 */
9918
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_DOWNSTREAM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9919
 
  __Pyx_GOTREF(__pyx_t_4);
9920
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DOWNSTREAM, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9921
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9922
 
 
9923
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":182
9924
 
 * UPSTREAM = ZMQ_UPSTREAM
9925
 
 * DOWNSTREAM = ZMQ_DOWNSTREAM
9926
 
 * HWM = ZMQ_HWM             # <<<<<<<<<<<<<<
9927
 
 * SWAP = ZMQ_SWAP
9928
 
 * AFFINITY = ZMQ_AFFINITY
9929
 
 */
9930
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_HWM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9931
 
  __Pyx_GOTREF(__pyx_t_4);
9932
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HWM, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9933
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9934
 
 
9935
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":183
9936
 
 * DOWNSTREAM = ZMQ_DOWNSTREAM
9937
 
 * HWM = ZMQ_HWM
9938
 
 * SWAP = ZMQ_SWAP             # <<<<<<<<<<<<<<
9939
 
 * AFFINITY = ZMQ_AFFINITY
9940
 
 * IDENTITY = ZMQ_IDENTITY
9941
 
 */
9942
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_SWAP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9943
 
  __Pyx_GOTREF(__pyx_t_4);
9944
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SWAP, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9945
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9946
 
 
9947
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":184
9948
 
 * HWM = ZMQ_HWM
9949
 
 * SWAP = ZMQ_SWAP
9950
 
 * AFFINITY = ZMQ_AFFINITY             # <<<<<<<<<<<<<<
9951
 
 * IDENTITY = ZMQ_IDENTITY
9952
 
 * SUBSCRIBE = ZMQ_SUBSCRIBE
9953
 
 */
9954
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_AFFINITY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9955
 
  __Pyx_GOTREF(__pyx_t_4);
9956
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__AFFINITY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9957
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9958
 
 
9959
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":185
9960
 
 * SWAP = ZMQ_SWAP
9961
 
 * AFFINITY = ZMQ_AFFINITY
9962
 
 * IDENTITY = ZMQ_IDENTITY             # <<<<<<<<<<<<<<
9963
 
 * SUBSCRIBE = ZMQ_SUBSCRIBE
9964
 
 * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
9965
 
 */
9966
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_IDENTITY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9967
 
  __Pyx_GOTREF(__pyx_t_4);
9968
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__IDENTITY, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9969
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9970
 
 
9971
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":186
9972
 
 * AFFINITY = ZMQ_AFFINITY
9973
 
 * IDENTITY = ZMQ_IDENTITY
9974
 
 * SUBSCRIBE = ZMQ_SUBSCRIBE             # <<<<<<<<<<<<<<
9975
 
 * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
9976
 
 * RATE = ZMQ_RATE
9977
 
 */
9978
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_SUBSCRIBE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9979
 
  __Pyx_GOTREF(__pyx_t_4);
9980
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SUBSCRIBE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9981
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9982
 
 
9983
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":187
9984
 
 * IDENTITY = ZMQ_IDENTITY
9985
 
 * SUBSCRIBE = ZMQ_SUBSCRIBE
9986
 
 * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE             # <<<<<<<<<<<<<<
9987
 
 * RATE = ZMQ_RATE
9988
 
 * RECOVERY_IVL = ZMQ_RECOVERY_IVL
9989
 
 */
9990
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_UNSUBSCRIBE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9991
 
  __Pyx_GOTREF(__pyx_t_4);
9992
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UNSUBSCRIBE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9993
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9994
 
 
9995
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":188
9996
 
 * SUBSCRIBE = ZMQ_SUBSCRIBE
9997
 
 * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
9998
 
 * RATE = ZMQ_RATE             # <<<<<<<<<<<<<<
9999
 
 * RECOVERY_IVL = ZMQ_RECOVERY_IVL
10000
 
 * MCAST_LOOP = ZMQ_MCAST_LOOP
10001
 
 */
10002
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_RATE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10003
 
  __Pyx_GOTREF(__pyx_t_4);
10004
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__RATE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10005
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10006
 
 
10007
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":189
10008
 
 * UNSUBSCRIBE = ZMQ_UNSUBSCRIBE
10009
 
 * RATE = ZMQ_RATE
10010
 
 * RECOVERY_IVL = ZMQ_RECOVERY_IVL             # <<<<<<<<<<<<<<
10011
 
 * MCAST_LOOP = ZMQ_MCAST_LOOP
10012
 
 * SNDBUF = ZMQ_SNDBUF
10013
 
 */
10014
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_RECOVERY_IVL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10015
 
  __Pyx_GOTREF(__pyx_t_4);
10016
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__RECOVERY_IVL, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10017
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10018
 
 
10019
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":190
10020
 
 * RATE = ZMQ_RATE
10021
 
 * RECOVERY_IVL = ZMQ_RECOVERY_IVL
10022
 
 * MCAST_LOOP = ZMQ_MCAST_LOOP             # <<<<<<<<<<<<<<
10023
 
 * SNDBUF = ZMQ_SNDBUF
10024
 
 * RCVBUF = ZMQ_RCVBUF
10025
 
 */
10026
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_MCAST_LOOP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10027
 
  __Pyx_GOTREF(__pyx_t_4);
10028
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__MCAST_LOOP, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10029
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10030
 
 
10031
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":191
10032
 
 * RECOVERY_IVL = ZMQ_RECOVERY_IVL
10033
 
 * MCAST_LOOP = ZMQ_MCAST_LOOP
10034
 
 * SNDBUF = ZMQ_SNDBUF             # <<<<<<<<<<<<<<
10035
 
 * RCVBUF = ZMQ_RCVBUF
10036
 
 * RCVMORE = ZMQ_RCVMORE
10037
 
 */
10038
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_SNDBUF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10039
 
  __Pyx_GOTREF(__pyx_t_4);
10040
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SNDBUF, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10041
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10042
 
 
10043
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":192
10044
 
 * MCAST_LOOP = ZMQ_MCAST_LOOP
10045
 
 * SNDBUF = ZMQ_SNDBUF
10046
 
 * RCVBUF = ZMQ_RCVBUF             # <<<<<<<<<<<<<<
10047
 
 * RCVMORE = ZMQ_RCVMORE
10048
 
 * SNDMORE = ZMQ_SNDMORE
10049
 
 */
10050
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_RCVBUF); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10051
 
  __Pyx_GOTREF(__pyx_t_4);
10052
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__RCVBUF, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10053
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10054
 
 
10055
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":193
10056
 
 * SNDBUF = ZMQ_SNDBUF
10057
 
 * RCVBUF = ZMQ_RCVBUF
10058
 
 * RCVMORE = ZMQ_RCVMORE             # <<<<<<<<<<<<<<
10059
 
 * SNDMORE = ZMQ_SNDMORE
10060
 
 * POLLIN = ZMQ_POLLIN
10061
 
 */
10062
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_RCVMORE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10063
 
  __Pyx_GOTREF(__pyx_t_4);
10064
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__RCVMORE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10065
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10066
 
 
10067
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":194
10068
 
 * RCVBUF = ZMQ_RCVBUF
10069
 
 * RCVMORE = ZMQ_RCVMORE
10070
 
 * SNDMORE = ZMQ_SNDMORE             # <<<<<<<<<<<<<<
10071
 
 * POLLIN = ZMQ_POLLIN
10072
 
 * POLLOUT = ZMQ_POLLOUT
10073
 
 */
10074
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_SNDMORE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10075
 
  __Pyx_GOTREF(__pyx_t_4);
10076
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__SNDMORE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10077
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10078
 
 
10079
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":195
10080
 
 * RCVMORE = ZMQ_RCVMORE
10081
 
 * SNDMORE = ZMQ_SNDMORE
10082
 
 * POLLIN = ZMQ_POLLIN             # <<<<<<<<<<<<<<
10083
 
 * POLLOUT = ZMQ_POLLOUT
10084
 
 * POLLERR = ZMQ_POLLERR
10085
 
 */
10086
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_POLLIN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10087
 
  __Pyx_GOTREF(__pyx_t_4);
10088
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__POLLIN, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10089
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10090
 
 
10091
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":196
10092
 
 * SNDMORE = ZMQ_SNDMORE
10093
 
 * POLLIN = ZMQ_POLLIN
10094
 
 * POLLOUT = ZMQ_POLLOUT             # <<<<<<<<<<<<<<
10095
 
 * POLLERR = ZMQ_POLLERR
10096
 
 * 
10097
 
 */
10098
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_POLLOUT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10099
 
  __Pyx_GOTREF(__pyx_t_4);
10100
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__POLLOUT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10101
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10102
 
 
10103
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":197
10104
 
 * POLLIN = ZMQ_POLLIN
10105
 
 * POLLOUT = ZMQ_POLLOUT
10106
 
 * POLLERR = ZMQ_POLLERR             # <<<<<<<<<<<<<<
10107
 
 * 
10108
 
 * #-----------------------------------------------------------------------------
10109
 
 */
10110
 
  __pyx_t_4 = PyInt_FromLong(ZMQ_POLLERR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10111
 
  __Pyx_GOTREF(__pyx_t_4);
10112
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__POLLERR, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10113
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10114
 
 
10115
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":204
10116
 
 * 
10117
 
 * # Often used (these are alse in errno.)
10118
 
 * EAGAIN = ZMQ_EAGAIN             # <<<<<<<<<<<<<<
10119
 
 * EINVAL = ZMQ_EINVAL
10120
 
 * 
10121
 
 */
10122
 
  __pyx_t_4 = PyInt_FromLong(EAGAIN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10123
 
  __Pyx_GOTREF(__pyx_t_4);
10124
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EAGAIN, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10125
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10126
 
 
10127
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":205
10128
 
 * # Often used (these are alse in errno.)
10129
 
 * EAGAIN = ZMQ_EAGAIN
10130
 
 * EINVAL = ZMQ_EINVAL             # <<<<<<<<<<<<<<
10131
 
 * 
10132
 
 * # For Windows compatability
10133
 
 */
10134
 
  __pyx_t_4 = PyInt_FromLong(EINVAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10135
 
  __Pyx_GOTREF(__pyx_t_4);
10136
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EINVAL, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10137
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10138
 
 
10139
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":208
10140
 
 * 
10141
 
 * # For Windows compatability
10142
 
 * ENOTSUP = ZMQ_ENOTSUP             # <<<<<<<<<<<<<<
10143
 
 * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
10144
 
 * ENOBUFS = ZMQ_ENOBUFS
10145
 
 */
10146
 
  __pyx_t_4 = PyInt_FromLong(ENOTSUP); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10147
 
  __Pyx_GOTREF(__pyx_t_4);
10148
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ENOTSUP, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10149
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10150
 
 
10151
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":209
10152
 
 * # For Windows compatability
10153
 
 * ENOTSUP = ZMQ_ENOTSUP
10154
 
 * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT             # <<<<<<<<<<<<<<
10155
 
 * ENOBUFS = ZMQ_ENOBUFS
10156
 
 * ENETDOWN = ZMQ_ENETDOWN
10157
 
 */
10158
 
  __pyx_t_4 = PyInt_FromLong(EPROTONOSUPPORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10159
 
  __Pyx_GOTREF(__pyx_t_4);
10160
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EPROTONOSUPPORT, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10161
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10162
 
 
10163
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":210
10164
 
 * ENOTSUP = ZMQ_ENOTSUP
10165
 
 * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
10166
 
 * ENOBUFS = ZMQ_ENOBUFS             # <<<<<<<<<<<<<<
10167
 
 * ENETDOWN = ZMQ_ENETDOWN
10168
 
 * EADDRINUSE = ZMQ_EADDRINUSE
10169
 
 */
10170
 
  __pyx_t_4 = PyInt_FromLong(ENOBUFS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10171
 
  __Pyx_GOTREF(__pyx_t_4);
10172
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ENOBUFS, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10173
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10174
 
 
10175
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":211
10176
 
 * EPROTONOSUPPORT = ZMQ_EPROTONOSUPPORT
10177
 
 * ENOBUFS = ZMQ_ENOBUFS
10178
 
 * ENETDOWN = ZMQ_ENETDOWN             # <<<<<<<<<<<<<<
10179
 
 * EADDRINUSE = ZMQ_EADDRINUSE
10180
 
 * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
10181
 
 */
10182
 
  __pyx_t_4 = PyInt_FromLong(ENETDOWN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10183
 
  __Pyx_GOTREF(__pyx_t_4);
10184
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ENETDOWN, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10185
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10186
 
 
10187
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":212
10188
 
 * ENOBUFS = ZMQ_ENOBUFS
10189
 
 * ENETDOWN = ZMQ_ENETDOWN
10190
 
 * EADDRINUSE = ZMQ_EADDRINUSE             # <<<<<<<<<<<<<<
10191
 
 * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
10192
 
 * ECONNREFUSED = ZMQ_ECONNREFUSED
10193
 
 */
10194
 
  __pyx_t_4 = PyInt_FromLong(EADDRINUSE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10195
 
  __Pyx_GOTREF(__pyx_t_4);
10196
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EADDRINUSE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10197
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10198
 
 
10199
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":213
10200
 
 * ENETDOWN = ZMQ_ENETDOWN
10201
 
 * EADDRINUSE = ZMQ_EADDRINUSE
10202
 
 * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL             # <<<<<<<<<<<<<<
10203
 
 * ECONNREFUSED = ZMQ_ECONNREFUSED
10204
 
 * EINPROGRESS = ZMQ_EINPROGRESS
10205
 
 */
10206
 
  __pyx_t_4 = PyInt_FromLong(EADDRNOTAVAIL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10207
 
  __Pyx_GOTREF(__pyx_t_4);
10208
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EADDRNOTAVAIL, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10209
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10210
 
 
10211
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":214
10212
 
 * EADDRINUSE = ZMQ_EADDRINUSE
10213
 
 * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
10214
 
 * ECONNREFUSED = ZMQ_ECONNREFUSED             # <<<<<<<<<<<<<<
10215
 
 * EINPROGRESS = ZMQ_EINPROGRESS
10216
 
 * 
10217
 
 */
10218
 
  __pyx_t_4 = PyInt_FromLong(ECONNREFUSED); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10219
 
  __Pyx_GOTREF(__pyx_t_4);
10220
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ECONNREFUSED, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10221
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10222
 
 
10223
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":215
10224
 
 * EADDRNOTAVAIL = ZMQ_EADDRNOTAVAIL
10225
 
 * ECONNREFUSED = ZMQ_ECONNREFUSED
10226
 
 * EINPROGRESS = ZMQ_EINPROGRESS             # <<<<<<<<<<<<<<
10227
 
 * 
10228
 
 * # 0MQ Native
10229
 
 */
10230
 
  __pyx_t_4 = PyInt_FromLong(EINPROGRESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10231
 
  __Pyx_GOTREF(__pyx_t_4);
10232
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EINPROGRESS, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10233
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10234
 
 
10235
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":218
10236
 
 * 
10237
 
 * # 0MQ Native
10238
 
 * EMTHREAD = ZMQ_EMTHREAD             # <<<<<<<<<<<<<<
10239
 
 * EFSM = ZMQ_EFSM
10240
 
 * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
10241
 
 */
10242
 
  __pyx_t_4 = PyInt_FromLong(EMTHREAD); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10243
 
  __Pyx_GOTREF(__pyx_t_4);
10244
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EMTHREAD, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10245
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10246
 
 
10247
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":219
10248
 
 * # 0MQ Native
10249
 
 * EMTHREAD = ZMQ_EMTHREAD
10250
 
 * EFSM = ZMQ_EFSM             # <<<<<<<<<<<<<<
10251
 
 * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
10252
 
 * ETERM = ZMQ_ETERM
10253
 
 */
10254
 
  __pyx_t_4 = PyInt_FromLong(EFSM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10255
 
  __Pyx_GOTREF(__pyx_t_4);
10256
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EFSM, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10257
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10258
 
 
10259
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":220
10260
 
 * EMTHREAD = ZMQ_EMTHREAD
10261
 
 * EFSM = ZMQ_EFSM
10262
 
 * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO             # <<<<<<<<<<<<<<
10263
 
 * ETERM = ZMQ_ETERM
10264
 
 * 
10265
 
 */
10266
 
  __pyx_t_4 = PyInt_FromLong(ENOCOMPATPROTO); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10267
 
  __Pyx_GOTREF(__pyx_t_4);
10268
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ENOCOMPATPROTO, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10269
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10270
 
 
10271
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":221
10272
 
 * EFSM = ZMQ_EFSM
10273
 
 * ENOCOMPATPROTO = ZMQ_ENOCOMPATPROTO
10274
 
 * ETERM = ZMQ_ETERM             # <<<<<<<<<<<<<<
10275
 
 * 
10276
 
 * 
10277
 
 */
10278
 
  __pyx_t_4 = PyInt_FromLong(ETERM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10279
 
  __Pyx_GOTREF(__pyx_t_4);
10280
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ETERM, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10281
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10282
 
 
10283
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":228
10284
 
 *     return zmq_strerror(errnum)
10285
 
 * 
10286
 
 * class ZMQBaseError(Exception):             # <<<<<<<<<<<<<<
10287
 
 *     pass
10288
 
 * 
10289
 
 */
10290
 
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10291
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10292
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10293
 
  __Pyx_GOTREF(__pyx_t_3);
10294
 
  __Pyx_INCREF(__pyx_builtin_Exception);
10295
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_Exception);
10296
 
  __Pyx_GIVEREF(__pyx_builtin_Exception);
10297
 
  __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_4), __pyx_n_s__ZMQBaseError, "zmq._zmq"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10298
 
  __Pyx_GOTREF(__pyx_t_1);
10299
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10300
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ZMQBaseError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10301
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10302
 
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10303
 
 
10304
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":231
10305
 
 *     pass
10306
 
 * 
10307
 
 * class ZMQError(ZMQBaseError):             # <<<<<<<<<<<<<<
10308
 
 *     """Base exception class for 0MQ errors in Python."""
10309
 
 * 
10310
 
 */
10311
 
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10312
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10313
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQBaseError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10314
 
  __Pyx_GOTREF(__pyx_t_1);
10315
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10316
 
  __Pyx_GOTREF(__pyx_t_3);
10317
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10318
 
  __Pyx_GIVEREF(__pyx_t_1);
10319
 
  __pyx_t_1 = 0;
10320
 
  if (PyDict_SetItemString(((PyObject *)__pyx_t_4), "__doc__", ((PyObject *)__pyx_kp_s_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10321
 
  __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_4), __pyx_n_s__ZMQError, "zmq._zmq"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10322
 
  __Pyx_GOTREF(__pyx_t_1);
10323
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10324
 
 
10325
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":234
10326
 
 *     """Base exception class for 0MQ errors in Python."""
10327
 
 * 
10328
 
 *     def __init__(self, error=None):             # <<<<<<<<<<<<<<
10329
 
 *         """Wrap an errno style error.
10330
 
 * 
10331
 
 */
10332
 
  __pyx_t_3 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_8ZMQError___init__, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10333
 
  __Pyx_GOTREF(__pyx_t_3);
10334
 
  __pyx_t_7 = PyMethod_New(__pyx_t_3, 0, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10335
 
  __Pyx_GOTREF(__pyx_t_7);
10336
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10337
 
  if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s____init__, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10338
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10339
 
 
10340
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":252
10341
 
 *             self.errno = None
10342
 
 * 
10343
 
 *     def __str__(self):             # <<<<<<<<<<<<<<
10344
 
 *         return self.errstr
10345
 
 * 
10346
 
 */
10347
 
  __pyx_t_7 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_8ZMQError___str__, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10348
 
  __Pyx_GOTREF(__pyx_t_7);
10349
 
  __pyx_t_3 = PyMethod_New(__pyx_t_7, 0, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10350
 
  __Pyx_GOTREF(__pyx_t_3);
10351
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10352
 
  if (PyObject_SetAttr(__pyx_t_1, __pyx_n_s____str__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10353
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10354
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ZMQError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10355
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10356
 
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10357
 
 
10358
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":255
10359
 
 *         return self.errstr
10360
 
 * 
10361
 
 * class ZMQBindError(ZMQBaseError):             # <<<<<<<<<<<<<<
10362
 
 *     """An error for bind_to_random_port."""
10363
 
 *     pass
10364
 
 */
10365
 
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10366
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10367
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ZMQBaseError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10368
 
  __Pyx_GOTREF(__pyx_t_1);
10369
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10370
 
  __Pyx_GOTREF(__pyx_t_3);
10371
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10372
 
  __Pyx_GIVEREF(__pyx_t_1);
10373
 
  __pyx_t_1 = 0;
10374
 
  if (PyDict_SetItemString(((PyObject *)__pyx_t_4), "__doc__", ((PyObject *)__pyx_kp_s_18)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10375
 
  __pyx_t_1 = __Pyx_CreateClass(__pyx_t_3, ((PyObject *)__pyx_t_4), __pyx_n_s__ZMQBindError, "zmq._zmq"); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10376
 
  __Pyx_GOTREF(__pyx_t_1);
10377
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10378
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ZMQBindError, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10379
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10380
 
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10381
 
 
10382
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":611
10383
 
 *     #-------------------------------------------------------------------------
10384
 
 * 
10385
 
 *     def send(self, object data, int flags=0, bool copy=True):             # <<<<<<<<<<<<<<
10386
 
 *         """Send a message on this socket.
10387
 
 * 
10388
 
 */
10389
 
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10390
 
  __Pyx_GOTREF(__pyx_t_4);
10391
 
  if (!(likely(PyBool_Check(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bool, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10392
 
  __pyx_k_5 = ((PyObject *)__pyx_t_4);
10393
 
  __Pyx_GIVEREF(__pyx_t_4);
10394
 
  __pyx_t_4 = 0;
10395
 
 
10396
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":729
10397
 
 *             raise ZMQError()
10398
 
 * 
10399
 
 *     def recv(self, int flags=0, copy=True):             # <<<<<<<<<<<<<<
10400
 
 *         """Receive a message.
10401
 
 * 
10402
 
 */
10403
 
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10404
 
  __Pyx_GOTREF(__pyx_t_4);
10405
 
  __pyx_k_6 = __pyx_t_4;
10406
 
  __Pyx_GIVEREF(__pyx_t_4);
10407
 
  __pyx_t_4 = 0;
10408
 
 
10409
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":795
10410
 
 *         return msg
10411
 
 * 
10412
 
 *     def send_multipart(self, msg_parts, int flags=0, copy=True):             # <<<<<<<<<<<<<<
10413
 
 *         """Send a sequence of messages as a multipart message.
10414
 
 * 
10415
 
 */
10416
 
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10417
 
  __Pyx_GOTREF(__pyx_t_4);
10418
 
  __pyx_k_7 = __pyx_t_4;
10419
 
  __Pyx_GIVEREF(__pyx_t_4);
10420
 
  __pyx_t_4 = 0;
10421
 
 
10422
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":811
10423
 
 *         self.send(msg_parts[-1], flags)
10424
 
 * 
10425
 
 *     def recv_multipart(self, int flags=0, copy=True):             # <<<<<<<<<<<<<<
10426
 
 *         """Receive a multipart message as a list of messages.
10427
 
 * 
10428
 
 */
10429
 
  __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10430
 
  __Pyx_GOTREF(__pyx_t_4);
10431
 
  __pyx_k_8 = __pyx_t_4;
10432
 
  __Pyx_GIVEREF(__pyx_t_4);
10433
 
  __pyx_t_4 = 0;
10434
 
 
10435
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1011
10436
 
 * 
10437
 
 * 
10438
 
 * class Poller(object):             # <<<<<<<<<<<<<<
10439
 
 *     """An stateful poll interface that mirrors Python's built-in poll."""
10440
 
 * 
10441
 
 */
10442
 
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10443
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10444
 
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10445
 
  __Pyx_GOTREF(__pyx_t_1);
10446
 
  __Pyx_INCREF(__pyx_builtin_object);
10447
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
10448
 
  __Pyx_GIVEREF(__pyx_builtin_object);
10449
 
  if (PyDict_SetItemString(((PyObject *)__pyx_t_4), "__doc__", ((PyObject *)__pyx_kp_s_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10450
 
  __pyx_t_3 = __Pyx_CreateClass(__pyx_t_1, ((PyObject *)__pyx_t_4), __pyx_n_s__Poller, "zmq._zmq"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10451
 
  __Pyx_GOTREF(__pyx_t_3);
10452
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10453
 
 
10454
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1014
10455
 
 *     """An stateful poll interface that mirrors Python's built-in poll."""
10456
 
 * 
10457
 
 *     def __init__(self):             # <<<<<<<<<<<<<<
10458
 
 *         self.sockets = {}
10459
 
 * 
10460
 
 */
10461
 
  __pyx_t_1 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_6Poller___init__, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10462
 
  __Pyx_GOTREF(__pyx_t_1);
10463
 
  __pyx_t_7 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10464
 
  __Pyx_GOTREF(__pyx_t_7);
10465
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10466
 
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10467
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10468
 
 
10469
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1017
10470
 
 *         self.sockets = {}
10471
 
 * 
10472
 
 *     def register(self, socket, flags=POLLIN|POLLOUT):             # <<<<<<<<<<<<<<
10473
 
 *         """Register a 0MQ socket or native fd for I/O monitoring.
10474
 
 * 
10475
 
 */
10476
 
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLIN); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10477
 
  __Pyx_GOTREF(__pyx_t_7);
10478
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10479
 
  __Pyx_GOTREF(__pyx_t_1);
10480
 
  __pyx_t_6 = PyNumber_Or(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10481
 
  __Pyx_GOTREF(__pyx_t_6);
10482
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10483
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10484
 
  __pyx_k_14 = __pyx_t_6;
10485
 
  __Pyx_GIVEREF(__pyx_t_6);
10486
 
  __pyx_t_6 = 0;
10487
 
  __pyx_t_6 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_6Poller_register, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10488
 
  __Pyx_GOTREF(__pyx_t_6);
10489
 
  __pyx_t_1 = PyMethod_New(__pyx_t_6, 0, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10490
 
  __Pyx_GOTREF(__pyx_t_1);
10491
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10492
 
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__register, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10493
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10494
 
 
10495
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1030
10496
 
 *         self.sockets[socket] = flags
10497
 
 * 
10498
 
 *     def modify(self, socket, flags=POLLIN|POLLOUT):             # <<<<<<<<<<<<<<
10499
 
 *         """Modify the flags for an already registered 0MQ socket or native fd."""
10500
 
 *         self.register(socket, flags)
10501
 
 */
10502
 
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10503
 
  __Pyx_GOTREF(__pyx_t_1);
10504
 
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__POLLOUT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10505
 
  __Pyx_GOTREF(__pyx_t_6);
10506
 
  __pyx_t_7 = PyNumber_Or(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10507
 
  __Pyx_GOTREF(__pyx_t_7);
10508
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10509
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10510
 
  __pyx_k_15 = __pyx_t_7;
10511
 
  __Pyx_GIVEREF(__pyx_t_7);
10512
 
  __pyx_t_7 = 0;
10513
 
  __pyx_t_7 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_6Poller_modify, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10514
 
  __Pyx_GOTREF(__pyx_t_7);
10515
 
  __pyx_t_6 = PyMethod_New(__pyx_t_7, 0, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10516
 
  __Pyx_GOTREF(__pyx_t_6);
10517
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10518
 
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__modify, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10519
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10520
 
 
10521
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1034
10522
 
 *         self.register(socket, flags)
10523
 
 * 
10524
 
 *     def unregister(self, socket):             # <<<<<<<<<<<<<<
10525
 
 *         """Remove a 0MQ socket or native fd for I/O monitoring.
10526
 
 * 
10527
 
 */
10528
 
  __pyx_t_6 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_6Poller_unregister, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10529
 
  __Pyx_GOTREF(__pyx_t_6);
10530
 
  __pyx_t_7 = PyMethod_New(__pyx_t_6, 0, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10531
 
  __Pyx_GOTREF(__pyx_t_7);
10532
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10533
 
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__unregister, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10534
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10535
 
 
10536
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1044
10537
 
 *         del self.sockets[socket]
10538
 
 * 
10539
 
 *     def poll(self, timeout=None):             # <<<<<<<<<<<<<<
10540
 
 *         """Poll the registered 0MQ or native fds for I/O.
10541
 
 * 
10542
 
 */
10543
 
  __pyx_t_7 = PyCFunction_New(&__pyx_mdef_3zmq_4_zmq_6Poller_poll, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10544
 
  __Pyx_GOTREF(__pyx_t_7);
10545
 
  __pyx_t_6 = PyMethod_New(__pyx_t_7, 0, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10546
 
  __Pyx_GOTREF(__pyx_t_6);
10547
 
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10548
 
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__poll, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10549
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10550
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Poller, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10551
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10552
 
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10553
 
 
10554
 
  /* "/Users/bgranger/Documents/Computation/zeromq/pyzmq/zmq/_zmq.pyx":1105
10555
 
 * 
10556
 
 * 
10557
 
 * __all__ = [             # <<<<<<<<<<<<<<
10558
 
 *     'Message',
10559
 
 *     'Context',
10560
 
 */
10561
 
  __pyx_t_4 = PyList_New(49); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10562
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10563
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Message));
10564
 
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__Message));
10565
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Message));
10566
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Context));
10567
 
  PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__Context));
10568
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Context));
10569
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Socket));
10570
 
  PyList_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_n_s__Socket));
10571
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Socket));
10572
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ZMQBaseError));
10573
 
  PyList_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_n_s__ZMQBaseError));
10574
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ZMQBaseError));
10575
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ZMQError));
10576
 
  PyList_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_n_s__ZMQError));
10577
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ZMQError));
10578
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ZMQBindError));
10579
 
  PyList_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_n_s__ZMQBindError));
10580
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ZMQBindError));
10581
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__NOBLOCK));
10582
 
  PyList_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_n_s__NOBLOCK));
10583
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__NOBLOCK));
10584
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PAIR));
10585
 
  PyList_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_n_s__PAIR));
10586
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PAIR));
10587
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PUB));
10588
 
  PyList_SET_ITEM(__pyx_t_4, 8, ((PyObject *)__pyx_n_s__PUB));
10589
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PUB));
10590
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SUB));
10591
 
  PyList_SET_ITEM(__pyx_t_4, 9, ((PyObject *)__pyx_n_s__SUB));
10592
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SUB));
10593
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__REQ));
10594
 
  PyList_SET_ITEM(__pyx_t_4, 10, ((PyObject *)__pyx_n_s__REQ));
10595
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__REQ));
10596
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__REP));
10597
 
  PyList_SET_ITEM(__pyx_t_4, 11, ((PyObject *)__pyx_n_s__REP));
10598
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__REP));
10599
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__XREQ));
10600
 
  PyList_SET_ITEM(__pyx_t_4, 12, ((PyObject *)__pyx_n_s__XREQ));
10601
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__XREQ));
10602
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__XREP));
10603
 
  PyList_SET_ITEM(__pyx_t_4, 13, ((PyObject *)__pyx_n_s__XREP));
10604
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__XREP));
10605
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__UPSTREAM));
10606
 
  PyList_SET_ITEM(__pyx_t_4, 14, ((PyObject *)__pyx_n_s__UPSTREAM));
10607
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__UPSTREAM));
10608
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__DOWNSTREAM));
10609
 
  PyList_SET_ITEM(__pyx_t_4, 15, ((PyObject *)__pyx_n_s__DOWNSTREAM));
10610
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DOWNSTREAM));
10611
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__HWM));
10612
 
  PyList_SET_ITEM(__pyx_t_4, 16, ((PyObject *)__pyx_n_s__HWM));
10613
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__HWM));
10614
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SWAP));
10615
 
  PyList_SET_ITEM(__pyx_t_4, 17, ((PyObject *)__pyx_n_s__SWAP));
10616
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SWAP));
10617
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__AFFINITY));
10618
 
  PyList_SET_ITEM(__pyx_t_4, 18, ((PyObject *)__pyx_n_s__AFFINITY));
10619
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__AFFINITY));
10620
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__IDENTITY));
10621
 
  PyList_SET_ITEM(__pyx_t_4, 19, ((PyObject *)__pyx_n_s__IDENTITY));
10622
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IDENTITY));
10623
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SUBSCRIBE));
10624
 
  PyList_SET_ITEM(__pyx_t_4, 20, ((PyObject *)__pyx_n_s__SUBSCRIBE));
10625
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SUBSCRIBE));
10626
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__UNSUBSCRIBE));
10627
 
  PyList_SET_ITEM(__pyx_t_4, 21, ((PyObject *)__pyx_n_s__UNSUBSCRIBE));
10628
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__UNSUBSCRIBE));
10629
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__RATE));
10630
 
  PyList_SET_ITEM(__pyx_t_4, 22, ((PyObject *)__pyx_n_s__RATE));
10631
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__RATE));
10632
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__RECOVERY_IVL));
10633
 
  PyList_SET_ITEM(__pyx_t_4, 23, ((PyObject *)__pyx_n_s__RECOVERY_IVL));
10634
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__RECOVERY_IVL));
10635
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__MCAST_LOOP));
10636
 
  PyList_SET_ITEM(__pyx_t_4, 24, ((PyObject *)__pyx_n_s__MCAST_LOOP));
10637
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__MCAST_LOOP));
10638
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SNDBUF));
10639
 
  PyList_SET_ITEM(__pyx_t_4, 25, ((PyObject *)__pyx_n_s__SNDBUF));
10640
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SNDBUF));
10641
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__RCVBUF));
10642
 
  PyList_SET_ITEM(__pyx_t_4, 26, ((PyObject *)__pyx_n_s__RCVBUF));
10643
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__RCVBUF));
10644
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SNDMORE));
10645
 
  PyList_SET_ITEM(__pyx_t_4, 27, ((PyObject *)__pyx_n_s__SNDMORE));
10646
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SNDMORE));
10647
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__RCVMORE));
10648
 
  PyList_SET_ITEM(__pyx_t_4, 28, ((PyObject *)__pyx_n_s__RCVMORE));
10649
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__RCVMORE));
10650
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__POLLIN));
10651
 
  PyList_SET_ITEM(__pyx_t_4, 29, ((PyObject *)__pyx_n_s__POLLIN));
10652
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__POLLIN));
10653
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__POLLOUT));
10654
 
  PyList_SET_ITEM(__pyx_t_4, 30, ((PyObject *)__pyx_n_s__POLLOUT));
10655
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__POLLOUT));
10656
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__POLLERR));
10657
 
  PyList_SET_ITEM(__pyx_t_4, 31, ((PyObject *)__pyx_n_s__POLLERR));
10658
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__POLLERR));
10659
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s___poll));
10660
 
  PyList_SET_ITEM(__pyx_t_4, 32, ((PyObject *)__pyx_n_s___poll));
10661
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___poll));
10662
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__select));
10663
 
  PyList_SET_ITEM(__pyx_t_4, 33, ((PyObject *)__pyx_n_s__select));
10664
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__select));
10665
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Poller));
10666
 
  PyList_SET_ITEM(__pyx_t_4, 34, ((PyObject *)__pyx_n_s__Poller));
10667
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Poller));
10668
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EAGAIN));
10669
 
  PyList_SET_ITEM(__pyx_t_4, 35, ((PyObject *)__pyx_n_s__EAGAIN));
10670
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EAGAIN));
10671
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EINVAL));
10672
 
  PyList_SET_ITEM(__pyx_t_4, 36, ((PyObject *)__pyx_n_s__EINVAL));
10673
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EINVAL));
10674
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ENOTSUP));
10675
 
  PyList_SET_ITEM(__pyx_t_4, 37, ((PyObject *)__pyx_n_s__ENOTSUP));
10676
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ENOTSUP));
10677
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EPROTONOSUPPORT));
10678
 
  PyList_SET_ITEM(__pyx_t_4, 38, ((PyObject *)__pyx_n_s__EPROTONOSUPPORT));
10679
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EPROTONOSUPPORT));
10680
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ENOBUFS));
10681
 
  PyList_SET_ITEM(__pyx_t_4, 39, ((PyObject *)__pyx_n_s__ENOBUFS));
10682
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ENOBUFS));
10683
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ENETDOWN));
10684
 
  PyList_SET_ITEM(__pyx_t_4, 40, ((PyObject *)__pyx_n_s__ENETDOWN));
10685
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ENETDOWN));
10686
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EADDRINUSE));
10687
 
  PyList_SET_ITEM(__pyx_t_4, 41, ((PyObject *)__pyx_n_s__EADDRINUSE));
10688
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EADDRINUSE));
10689
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EADDRNOTAVAIL));
10690
 
  PyList_SET_ITEM(__pyx_t_4, 42, ((PyObject *)__pyx_n_s__EADDRNOTAVAIL));
10691
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EADDRNOTAVAIL));
10692
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ECONNREFUSED));
10693
 
  PyList_SET_ITEM(__pyx_t_4, 43, ((PyObject *)__pyx_n_s__ECONNREFUSED));
10694
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ECONNREFUSED));
10695
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EINPROGRESS));
10696
 
  PyList_SET_ITEM(__pyx_t_4, 44, ((PyObject *)__pyx_n_s__EINPROGRESS));
10697
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EINPROGRESS));
10698
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EMTHREAD));
10699
 
  PyList_SET_ITEM(__pyx_t_4, 45, ((PyObject *)__pyx_n_s__EMTHREAD));
10700
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EMTHREAD));
10701
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EFSM));
10702
 
  PyList_SET_ITEM(__pyx_t_4, 46, ((PyObject *)__pyx_n_s__EFSM));
10703
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EFSM));
10704
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ENOCOMPATPROTO));
10705
 
  PyList_SET_ITEM(__pyx_t_4, 47, ((PyObject *)__pyx_n_s__ENOCOMPATPROTO));
10706
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ENOCOMPATPROTO));
10707
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ETERM));
10708
 
  PyList_SET_ITEM(__pyx_t_4, 48, ((PyObject *)__pyx_n_s__ETERM));
10709
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ETERM));
10710
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10711
 
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
10712
 
 
10713
 
  /* "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/Cython/Includes/stdlib.pxd":2
10714
 
 * 
10715
 
 * cdef extern from "stdlib.h" nogil:             # <<<<<<<<<<<<<<
10716
 
 *     void free(void *ptr)
10717
 
 *     void *malloc(size_t size)
10718
 
 */
10719
 
  goto __pyx_L0;
10720
 
  __pyx_L1_error:;
10721
 
  __Pyx_XDECREF(__pyx_t_1);
10722
 
  __Pyx_XDECREF(__pyx_t_3);
10723
 
  __Pyx_XDECREF(__pyx_t_4);
10724
 
  __Pyx_XDECREF(__pyx_t_5);
10725
 
  __Pyx_XDECREF(__pyx_t_6);
10726
 
  __Pyx_XDECREF(__pyx_t_7);
10727
 
  if (__pyx_m) {
10728
 
    __Pyx_AddTraceback("init zmq._zmq");
10729
 
    Py_DECREF(__pyx_m); __pyx_m = 0;
10730
 
  } else if (!PyErr_Occurred()) {
10731
 
    PyErr_SetString(PyExc_ImportError, "init zmq._zmq");
10732
 
  }
10733
 
  __pyx_L0:;
10734
 
  __Pyx_RefNannyFinishContext();
10735
 
  #if PY_MAJOR_VERSION < 3
10736
 
  return;
10737
 
  #else
10738
 
  return __pyx_m;
10739
 
  #endif
10740
 
}
10741
 
 
10742
 
static const char *__pyx_filenames[] = {
10743
 
  "_zmq.pyx",
10744
 
  "allocate.pxi",
10745
 
};
10746
 
 
10747
 
/* Runtime support code */
10748
 
 
10749
 
static void __pyx_init_filenames(void) {
10750
 
  __pyx_f = __pyx_filenames;
10751
 
}
10752
 
 
10753
 
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
10754
 
    PyObject *local_type, *local_value, *local_tb;
10755
 
    PyObject *tmp_type, *tmp_value, *tmp_tb;
10756
 
    PyThreadState *tstate = PyThreadState_GET();
10757
 
    local_type = tstate->curexc_type;
10758
 
    local_value = tstate->curexc_value;
10759
 
    local_tb = tstate->curexc_traceback;
10760
 
    tstate->curexc_type = 0;
10761
 
    tstate->curexc_value = 0;
10762
 
    tstate->curexc_traceback = 0;
10763
 
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
10764
 
    if (unlikely(tstate->curexc_type))
10765
 
        goto bad;
10766
 
    #if PY_MAJOR_VERSION >= 3
10767
 
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
10768
 
        goto bad;
10769
 
    #endif
10770
 
    *type = local_type;
10771
 
    *value = local_value;
10772
 
    *tb = local_tb;
10773
 
    Py_INCREF(local_type);
10774
 
    Py_INCREF(local_value);
10775
 
    Py_INCREF(local_tb);
10776
 
    tmp_type = tstate->exc_type;
10777
 
    tmp_value = tstate->exc_value;
10778
 
    tmp_tb = tstate->exc_traceback;
10779
 
    tstate->exc_type = local_type;
10780
 
    tstate->exc_value = local_value;
10781
 
    tstate->exc_traceback = local_tb;
10782
 
    /* Make sure tstate is in a consistent state when we XDECREF
10783
 
       these objects (XDECREF may run arbitrary code). */
10784
 
    Py_XDECREF(tmp_type);
10785
 
    Py_XDECREF(tmp_value);
10786
 
    Py_XDECREF(tmp_tb);
10787
 
    return 0;
10788
 
bad:
10789
 
    *type = 0;
10790
 
    *value = 0;
10791
 
    *tb = 0;
10792
 
    Py_XDECREF(local_type);
10793
 
    Py_XDECREF(local_value);
10794
 
    Py_XDECREF(local_tb);
10795
 
    return -1;
10796
 
}
10797
 
 
10798
 
 
10799
 
static void __Pyx_RaiseDoubleKeywordsError(
10800
 
    const char* func_name,
10801
 
    PyObject* kw_name)
10802
 
{
10803
 
    PyErr_Format(PyExc_TypeError,
10804
 
        #if PY_MAJOR_VERSION >= 3
10805
 
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
10806
 
        #else
10807
 
        "%s() got multiple values for keyword argument '%s'", func_name,
10808
 
        PyString_AS_STRING(kw_name));
10809
 
        #endif
10810
 
}
10811
 
 
10812
 
static void __Pyx_RaiseArgtupleInvalid(
10813
 
    const char* func_name,
10814
 
    int exact,
10815
 
    Py_ssize_t num_min,
10816
 
    Py_ssize_t num_max,
10817
 
    Py_ssize_t num_found)
10818
 
{
10819
 
    Py_ssize_t num_expected;
10820
 
    const char *number, *more_or_less;
10821
 
 
10822
 
    if (num_found < num_min) {
10823
 
        num_expected = num_min;
10824
 
        more_or_less = "at least";
10825
 
    } else {
10826
 
        num_expected = num_max;
10827
 
        more_or_less = "at most";
10828
 
    }
10829
 
    if (exact) {
10830
 
        more_or_less = "exactly";
10831
 
    }
10832
 
    number = (num_expected == 1) ? "" : "s";
10833
 
    PyErr_Format(PyExc_TypeError,
10834
 
        #if PY_VERSION_HEX < 0x02050000
10835
 
            "%s() takes %s %d positional argument%s (%d given)",
10836
 
        #else
10837
 
            "%s() takes %s %zd positional argument%s (%zd given)",
10838
 
        #endif
10839
 
        func_name, more_or_less, num_expected, number, num_found);
10840
 
}
10841
 
 
10842
 
static int __Pyx_ParseOptionalKeywords(
10843
 
    PyObject *kwds,
10844
 
    PyObject **argnames[],
10845
 
    PyObject *kwds2,
10846
 
    PyObject *values[],
10847
 
    Py_ssize_t num_pos_args,
10848
 
    const char* function_name)
10849
 
{
10850
 
    PyObject *key = 0, *value = 0;
10851
 
    Py_ssize_t pos = 0;
10852
 
    PyObject*** name;
10853
 
    PyObject*** first_kw_arg = argnames + num_pos_args;
10854
 
 
10855
 
    while (PyDict_Next(kwds, &pos, &key, &value)) {
10856
 
        name = first_kw_arg;
10857
 
        while (*name && (**name != key)) name++;
10858
 
        if (*name) {
10859
 
            values[name-argnames] = value;
10860
 
        } else {
10861
 
            #if PY_MAJOR_VERSION < 3
10862
 
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
10863
 
            #else
10864
 
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
10865
 
            #endif
10866
 
                goto invalid_keyword_type;
10867
 
            } else {
10868
 
                for (name = first_kw_arg; *name; name++) {
10869
 
                    #if PY_MAJOR_VERSION >= 3
10870
 
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
10871
 
                        PyUnicode_Compare(**name, key) == 0) break;
10872
 
                    #else
10873
 
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
10874
 
                        _PyString_Eq(**name, key)) break;
10875
 
                    #endif
10876
 
                }
10877
 
                if (*name) {
10878
 
                    values[name-argnames] = value;
10879
 
                } else {
10880
 
                    /* unexpected keyword found */
10881
 
                    for (name=argnames; name != first_kw_arg; name++) {
10882
 
                        if (**name == key) goto arg_passed_twice;
10883
 
                        #if PY_MAJOR_VERSION >= 3
10884
 
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
10885
 
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
10886
 
                        #else
10887
 
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
10888
 
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
10889
 
                        #endif
10890
 
                    }
10891
 
                    if (kwds2) {
10892
 
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
10893
 
                    } else {
10894
 
                        goto invalid_keyword;
10895
 
                    }
10896
 
                }
10897
 
            }
10898
 
        }
10899
 
    }
10900
 
    return 0;
10901
 
arg_passed_twice:
10902
 
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
10903
 
    goto bad;
10904
 
invalid_keyword_type:
10905
 
    PyErr_Format(PyExc_TypeError,
10906
 
        "%s() keywords must be strings", function_name);
10907
 
    goto bad;
10908
 
invalid_keyword:
10909
 
    PyErr_Format(PyExc_TypeError,
10910
 
    #if PY_MAJOR_VERSION < 3
10911
 
        "%s() got an unexpected keyword argument '%s'",
10912
 
        function_name, PyString_AsString(key));
10913
 
    #else
10914
 
        "%s() got an unexpected keyword argument '%U'",
10915
 
        function_name, key);
10916
 
    #endif
10917
 
bad:
10918
 
    return -1;
10919
 
}
10920
 
 
10921
 
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
10922
 
    if (unlikely(!type)) {
10923
 
        PyErr_Format(PyExc_SystemError, "Missing type object");
10924
 
        return 0;
10925
 
    }
10926
 
    if (likely(PyObject_TypeCheck(obj, type)))
10927
 
        return 1;
10928
 
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
10929
 
                 Py_TYPE(obj)->tp_name, type->tp_name);
10930
 
    return 0;
10931
 
}
10932
 
 
10933
 
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
10934
 
    PyObject *tmp_type, *tmp_value, *tmp_tb;
10935
 
    PyThreadState *tstate = PyThreadState_GET();
10936
 
 
10937
 
    tmp_type = tstate->curexc_type;
10938
 
    tmp_value = tstate->curexc_value;
10939
 
    tmp_tb = tstate->curexc_traceback;
10940
 
    tstate->curexc_type = type;
10941
 
    tstate->curexc_value = value;
10942
 
    tstate->curexc_traceback = tb;
10943
 
    Py_XDECREF(tmp_type);
10944
 
    Py_XDECREF(tmp_value);
10945
 
    Py_XDECREF(tmp_tb);
10946
 
}
10947
 
 
10948
 
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
10949
 
    PyThreadState *tstate = PyThreadState_GET();
10950
 
    *type = tstate->curexc_type;
10951
 
    *value = tstate->curexc_value;
10952
 
    *tb = tstate->curexc_traceback;
10953
 
 
10954
 
    tstate->curexc_type = 0;
10955
 
    tstate->curexc_value = 0;
10956
 
    tstate->curexc_traceback = 0;
10957
 
}
10958
 
 
10959
 
 
10960
 
 
10961
 
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
10962
 
    PyErr_Format(PyExc_ValueError,
10963
 
        #if PY_VERSION_HEX < 0x02050000
10964
 
                 "need more than %d value%s to unpack", (int)index,
10965
 
        #else
10966
 
                 "need more than %zd value%s to unpack", index,
10967
 
        #endif
10968
 
                 (index == 1) ? "" : "s");
10969
 
}
10970
 
 
10971
 
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) {
10972
 
    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
10973
 
}
10974
 
 
10975
 
static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
10976
 
    PyObject *item;
10977
 
    if (!(item = PyIter_Next(iter))) {
10978
 
        if (!PyErr_Occurred()) {
10979
 
            __Pyx_RaiseNeedMoreValuesError(index);
10980
 
        }
10981
 
    }
10982
 
    return item;
10983
 
}
10984
 
 
10985
 
static int __Pyx_EndUnpack(PyObject *iter) {
10986
 
    PyObject *item;
10987
 
    if ((item = PyIter_Next(iter))) {
10988
 
        Py_DECREF(item);
10989
 
        __Pyx_RaiseTooManyValuesError();
10990
 
        return -1;
10991
 
    }
10992
 
    else if (!PyErr_Occurred())
10993
 
        return 0;
10994
 
    else
10995
 
        return -1;
10996
 
}
10997
 
 
10998
 
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
10999
 
    PyThreadState *tstate = PyThreadState_GET();
11000
 
    *type = tstate->exc_type;
11001
 
    *value = tstate->exc_value;
11002
 
    *tb = tstate->exc_traceback;
11003
 
    Py_XINCREF(*type);
11004
 
    Py_XINCREF(*value);
11005
 
    Py_XINCREF(*tb);
11006
 
}
11007
 
 
11008
 
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
11009
 
    PyObject *tmp_type, *tmp_value, *tmp_tb;
11010
 
    PyThreadState *tstate = PyThreadState_GET();
11011
 
    tmp_type = tstate->exc_type;
11012
 
    tmp_value = tstate->exc_value;
11013
 
    tmp_tb = tstate->exc_traceback;
11014
 
    tstate->exc_type = type;
11015
 
    tstate->exc_value = value;
11016
 
    tstate->exc_traceback = tb;
11017
 
    Py_XDECREF(tmp_type);
11018
 
    Py_XDECREF(tmp_value);
11019
 
    Py_XDECREF(tmp_tb);
11020
 
}
11021
 
 
11022
 
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
11023
 
    const char *name, int exact)
11024
 
{
11025
 
    if (!type) {
11026
 
        PyErr_Format(PyExc_SystemError, "Missing type object");
11027
 
        return 0;
11028
 
    }
11029
 
    if (none_allowed && obj == Py_None) return 1;
11030
 
    else if (exact) {
11031
 
        if (Py_TYPE(obj) == type) return 1;
11032
 
    }
11033
 
    else {
11034
 
        if (PyObject_TypeCheck(obj, type)) return 1;
11035
 
    }
11036
 
    PyErr_Format(PyExc_TypeError,
11037
 
        "Argument '%s' has incorrect type (expected %s, got %s)",
11038
 
        name, type->tp_name, Py_TYPE(obj)->tp_name);
11039
 
    return 0;
11040
 
}
11041
 
 
11042
 
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
11043
 
    PyObject *__import__ = 0;
11044
 
    PyObject *empty_list = 0;
11045
 
    PyObject *module = 0;
11046
 
    PyObject *global_dict = 0;
11047
 
    PyObject *empty_dict = 0;
11048
 
    PyObject *list;
11049
 
    __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
11050
 
    if (!__import__)
11051
 
        goto bad;
11052
 
    if (from_list)
11053
 
        list = from_list;
11054
 
    else {
11055
 
        empty_list = PyList_New(0);
11056
 
        if (!empty_list)
11057
 
            goto bad;
11058
 
        list = empty_list;
11059
 
    }
11060
 
    global_dict = PyModule_GetDict(__pyx_m);
11061
 
    if (!global_dict)
11062
 
        goto bad;
11063
 
    empty_dict = PyDict_New();
11064
 
    if (!empty_dict)
11065
 
        goto bad;
11066
 
    module = PyObject_CallFunctionObjArgs(__import__,
11067
 
        name, global_dict, empty_dict, list, NULL);
11068
 
bad:
11069
 
    Py_XDECREF(empty_list);
11070
 
    Py_XDECREF(__import__);
11071
 
    Py_XDECREF(empty_dict);
11072
 
    return module;
11073
 
}
11074
 
 
11075
 
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
11076
 
    PyObject *result;
11077
 
    result = PyObject_GetAttr(dict, name);
11078
 
    if (!result)
11079
 
        PyErr_SetObject(PyExc_NameError, name);
11080
 
    return result;
11081
 
}
11082
 
 
11083
 
static PyObject *__Pyx_CreateClass(
11084
 
    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
11085
 
{
11086
 
    PyObject *py_modname;
11087
 
    PyObject *result = 0;
11088
 
 
11089
 
    #if PY_MAJOR_VERSION < 3
11090
 
    py_modname = PyString_FromString(modname);
11091
 
    #else
11092
 
    py_modname = PyUnicode_FromString(modname);
11093
 
    #endif
11094
 
    if (!py_modname)
11095
 
        goto bad;
11096
 
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
11097
 
        goto bad;
11098
 
    #if PY_MAJOR_VERSION < 3
11099
 
    result = PyClass_New(bases, dict, name);
11100
 
    #else
11101
 
    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
11102
 
    #endif
11103
 
bad:
11104
 
    Py_XDECREF(py_modname);
11105
 
    return result;
11106
 
}
11107
 
 
11108
 
#if PY_MAJOR_VERSION < 3
11109
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
11110
 
    Py_XINCREF(type);
11111
 
    Py_XINCREF(value);
11112
 
    Py_XINCREF(tb);
11113
 
    /* First, check the traceback argument, replacing None with NULL. */
11114
 
    if (tb == Py_None) {
11115
 
        Py_DECREF(tb);
11116
 
        tb = 0;
11117
 
    }
11118
 
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
11119
 
        PyErr_SetString(PyExc_TypeError,
11120
 
            "raise: arg 3 must be a traceback or None");
11121
 
        goto raise_error;
11122
 
    }
11123
 
    /* Next, replace a missing value with None */
11124
 
    if (value == NULL) {
11125
 
        value = Py_None;
11126
 
        Py_INCREF(value);
11127
 
    }
11128
 
    #if PY_VERSION_HEX < 0x02050000
11129
 
    if (!PyClass_Check(type))
11130
 
    #else
11131
 
    if (!PyType_Check(type))
11132
 
    #endif
11133
 
    {
11134
 
        /* Raising an instance.  The value should be a dummy. */
11135
 
        if (value != Py_None) {
11136
 
            PyErr_SetString(PyExc_TypeError,
11137
 
                "instance exception may not have a separate value");
11138
 
            goto raise_error;
11139
 
        }
11140
 
        /* Normalize to raise <class>, <instance> */
11141
 
        Py_DECREF(value);
11142
 
        value = type;
11143
 
        #if PY_VERSION_HEX < 0x02050000
11144
 
            if (PyInstance_Check(type)) {
11145
 
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
11146
 
                Py_INCREF(type);
11147
 
            }
11148
 
            else {
11149
 
                type = 0;
11150
 
                PyErr_SetString(PyExc_TypeError,
11151
 
                    "raise: exception must be an old-style class or instance");
11152
 
                goto raise_error;
11153
 
            }
11154
 
        #else
11155
 
            type = (PyObject*) Py_TYPE(type);
11156
 
            Py_INCREF(type);
11157
 
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
11158
 
                PyErr_SetString(PyExc_TypeError,
11159
 
                    "raise: exception class must be a subclass of BaseException");
11160
 
                goto raise_error;
11161
 
            }
11162
 
        #endif
11163
 
    }
11164
 
 
11165
 
    __Pyx_ErrRestore(type, value, tb);
11166
 
    return;
11167
 
raise_error:
11168
 
    Py_XDECREF(value);
11169
 
    Py_XDECREF(type);
11170
 
    Py_XDECREF(tb);
11171
 
    return;
11172
 
}
11173
 
 
11174
 
#else /* Python 3+ */
11175
 
 
11176
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
11177
 
    if (tb == Py_None) {
11178
 
        tb = 0;
11179
 
    } else if (tb && !PyTraceBack_Check(tb)) {
11180
 
        PyErr_SetString(PyExc_TypeError,
11181
 
            "raise: arg 3 must be a traceback or None");
11182
 
        goto bad;
11183
 
    }
11184
 
    if (value == Py_None)
11185
 
        value = 0;
11186
 
 
11187
 
    if (PyExceptionInstance_Check(type)) {
11188
 
        if (value) {
11189
 
            PyErr_SetString(PyExc_TypeError,
11190
 
                "instance exception may not have a separate value");
11191
 
            goto bad;
11192
 
        }
11193
 
        value = type;
11194
 
        type = (PyObject*) Py_TYPE(value);
11195
 
    } else if (!PyExceptionClass_Check(type)) {
11196
 
        PyErr_SetString(PyExc_TypeError,
11197
 
            "raise: exception class must be a subclass of BaseException");
11198
 
        goto bad;
11199
 
    }
11200
 
 
11201
 
    PyErr_SetObject(type, value);
11202
 
 
11203
 
    if (tb) {
11204
 
        PyThreadState *tstate = PyThreadState_GET();
11205
 
        PyObject* tmp_tb = tstate->curexc_traceback;
11206
 
        if (tb != tmp_tb) {
11207
 
            Py_INCREF(tb);
11208
 
            tstate->curexc_traceback = tb;
11209
 
            Py_XDECREF(tmp_tb);
11210
 
        }
11211
 
    }
11212
 
 
11213
 
bad:
11214
 
    return;
11215
 
}
11216
 
#endif
11217
 
 
11218
 
static CYTHON_INLINE pyzmq_int64_t __Pyx_PyInt_from_py_pyzmq_int64_t(PyObject* x) {
11219
 
    const pyzmq_int64_t neg_one = (pyzmq_int64_t)-1, const_zero = 0;
11220
 
    const int is_unsigned = neg_one > const_zero;
11221
 
    if (sizeof(pyzmq_int64_t) == sizeof(char)) {
11222
 
        if (is_unsigned)
11223
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsUnsignedChar(x);
11224
 
        else
11225
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsSignedChar(x);
11226
 
    } else if (sizeof(pyzmq_int64_t) == sizeof(short)) {
11227
 
        if (is_unsigned)
11228
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsUnsignedShort(x);
11229
 
        else
11230
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsSignedShort(x);
11231
 
    } else if (sizeof(pyzmq_int64_t) == sizeof(int)) {
11232
 
        if (is_unsigned)
11233
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsUnsignedInt(x);
11234
 
        else
11235
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsSignedInt(x);
11236
 
    } else if (sizeof(pyzmq_int64_t) == sizeof(long)) {
11237
 
        if (is_unsigned)
11238
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsUnsignedLong(x);
11239
 
        else
11240
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsSignedLong(x);
11241
 
    } else if (sizeof(pyzmq_int64_t) == sizeof(PY_LONG_LONG)) {
11242
 
        if (is_unsigned)
11243
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsUnsignedLongLong(x);
11244
 
        else
11245
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsSignedLongLong(x);
11246
 
#if 0
11247
 
    } else if (sizeof(pyzmq_int64_t) > sizeof(short) &&
11248
 
               sizeof(pyzmq_int64_t) < sizeof(int)) { /*  __int32 ILP64 ? */
11249
 
        if (is_unsigned)
11250
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsUnsignedInt(x);
11251
 
        else
11252
 
            return (pyzmq_int64_t)__Pyx_PyInt_AsSignedInt(x);
11253
 
#endif
11254
 
    }
11255
 
    PyErr_SetString(PyExc_TypeError, "pyzmq_int64_t");
11256
 
    return (pyzmq_int64_t)-1;
11257
 
}
11258
 
 
11259
 
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_pyzmq_int64_t(pyzmq_int64_t val) {
11260
 
    const pyzmq_int64_t neg_one = (pyzmq_int64_t)-1, const_zero = 0;
11261
 
    const int is_unsigned = neg_one > const_zero;
11262
 
    if (sizeof(pyzmq_int64_t) <  sizeof(long)) {
11263
 
        return PyInt_FromLong((long)val);
11264
 
    } else if (sizeof(pyzmq_int64_t) == sizeof(long)) {
11265
 
        if (is_unsigned)
11266
 
            return PyLong_FromUnsignedLong((unsigned long)val);
11267
 
        else
11268
 
            return PyInt_FromLong((long)val);
11269
 
    } else { /* (sizeof(pyzmq_int64_t) > sizeof(long)) */
11270
 
        if (is_unsigned)
11271
 
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
11272
 
        else
11273
 
            return PyLong_FromLongLong((PY_LONG_LONG)val);
11274
 
    }
11275
 
}
11276
 
 
11277
 
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
11278
 
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
11279
 
    const int is_unsigned = neg_one > const_zero;
11280
 
    if (sizeof(unsigned char) < sizeof(long)) {
11281
 
        long val = __Pyx_PyInt_AsLong(x);
11282
 
        if (unlikely(val != (long)(unsigned char)val)) {
11283
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11284
 
                PyErr_SetString(PyExc_OverflowError,
11285
 
                    (is_unsigned && unlikely(val < 0)) ?
11286
 
                    "can't convert negative value to unsigned char" :
11287
 
                    "value too large to convert to unsigned char");
11288
 
            }
11289
 
            return (unsigned char)-1;
11290
 
        }
11291
 
        return (unsigned char)val;
11292
 
    }
11293
 
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
11294
 
}
11295
 
 
11296
 
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
11297
 
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
11298
 
    const int is_unsigned = neg_one > const_zero;
11299
 
    if (sizeof(unsigned short) < sizeof(long)) {
11300
 
        long val = __Pyx_PyInt_AsLong(x);
11301
 
        if (unlikely(val != (long)(unsigned short)val)) {
11302
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11303
 
                PyErr_SetString(PyExc_OverflowError,
11304
 
                    (is_unsigned && unlikely(val < 0)) ?
11305
 
                    "can't convert negative value to unsigned short" :
11306
 
                    "value too large to convert to unsigned short");
11307
 
            }
11308
 
            return (unsigned short)-1;
11309
 
        }
11310
 
        return (unsigned short)val;
11311
 
    }
11312
 
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
11313
 
}
11314
 
 
11315
 
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
11316
 
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
11317
 
    const int is_unsigned = neg_one > const_zero;
11318
 
    if (sizeof(unsigned int) < sizeof(long)) {
11319
 
        long val = __Pyx_PyInt_AsLong(x);
11320
 
        if (unlikely(val != (long)(unsigned int)val)) {
11321
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11322
 
                PyErr_SetString(PyExc_OverflowError,
11323
 
                    (is_unsigned && unlikely(val < 0)) ?
11324
 
                    "can't convert negative value to unsigned int" :
11325
 
                    "value too large to convert to unsigned int");
11326
 
            }
11327
 
            return (unsigned int)-1;
11328
 
        }
11329
 
        return (unsigned int)val;
11330
 
    }
11331
 
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
11332
 
}
11333
 
 
11334
 
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
11335
 
    const char neg_one = (char)-1, const_zero = 0;
11336
 
    const int is_unsigned = neg_one > const_zero;
11337
 
    if (sizeof(char) < sizeof(long)) {
11338
 
        long val = __Pyx_PyInt_AsLong(x);
11339
 
        if (unlikely(val != (long)(char)val)) {
11340
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11341
 
                PyErr_SetString(PyExc_OverflowError,
11342
 
                    (is_unsigned && unlikely(val < 0)) ?
11343
 
                    "can't convert negative value to char" :
11344
 
                    "value too large to convert to char");
11345
 
            }
11346
 
            return (char)-1;
11347
 
        }
11348
 
        return (char)val;
11349
 
    }
11350
 
    return (char)__Pyx_PyInt_AsLong(x);
11351
 
}
11352
 
 
11353
 
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
11354
 
    const short neg_one = (short)-1, const_zero = 0;
11355
 
    const int is_unsigned = neg_one > const_zero;
11356
 
    if (sizeof(short) < sizeof(long)) {
11357
 
        long val = __Pyx_PyInt_AsLong(x);
11358
 
        if (unlikely(val != (long)(short)val)) {
11359
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11360
 
                PyErr_SetString(PyExc_OverflowError,
11361
 
                    (is_unsigned && unlikely(val < 0)) ?
11362
 
                    "can't convert negative value to short" :
11363
 
                    "value too large to convert to short");
11364
 
            }
11365
 
            return (short)-1;
11366
 
        }
11367
 
        return (short)val;
11368
 
    }
11369
 
    return (short)__Pyx_PyInt_AsLong(x);
11370
 
}
11371
 
 
11372
 
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
11373
 
    const int neg_one = (int)-1, const_zero = 0;
11374
 
    const int is_unsigned = neg_one > const_zero;
11375
 
    if (sizeof(int) < sizeof(long)) {
11376
 
        long val = __Pyx_PyInt_AsLong(x);
11377
 
        if (unlikely(val != (long)(int)val)) {
11378
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11379
 
                PyErr_SetString(PyExc_OverflowError,
11380
 
                    (is_unsigned && unlikely(val < 0)) ?
11381
 
                    "can't convert negative value to int" :
11382
 
                    "value too large to convert to int");
11383
 
            }
11384
 
            return (int)-1;
11385
 
        }
11386
 
        return (int)val;
11387
 
    }
11388
 
    return (int)__Pyx_PyInt_AsLong(x);
11389
 
}
11390
 
 
11391
 
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
11392
 
    const signed char neg_one = (signed char)-1, const_zero = 0;
11393
 
    const int is_unsigned = neg_one > const_zero;
11394
 
    if (sizeof(signed char) < sizeof(long)) {
11395
 
        long val = __Pyx_PyInt_AsLong(x);
11396
 
        if (unlikely(val != (long)(signed char)val)) {
11397
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11398
 
                PyErr_SetString(PyExc_OverflowError,
11399
 
                    (is_unsigned && unlikely(val < 0)) ?
11400
 
                    "can't convert negative value to signed char" :
11401
 
                    "value too large to convert to signed char");
11402
 
            }
11403
 
            return (signed char)-1;
11404
 
        }
11405
 
        return (signed char)val;
11406
 
    }
11407
 
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
11408
 
}
11409
 
 
11410
 
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
11411
 
    const signed short neg_one = (signed short)-1, const_zero = 0;
11412
 
    const int is_unsigned = neg_one > const_zero;
11413
 
    if (sizeof(signed short) < sizeof(long)) {
11414
 
        long val = __Pyx_PyInt_AsLong(x);
11415
 
        if (unlikely(val != (long)(signed short)val)) {
11416
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11417
 
                PyErr_SetString(PyExc_OverflowError,
11418
 
                    (is_unsigned && unlikely(val < 0)) ?
11419
 
                    "can't convert negative value to signed short" :
11420
 
                    "value too large to convert to signed short");
11421
 
            }
11422
 
            return (signed short)-1;
11423
 
        }
11424
 
        return (signed short)val;
11425
 
    }
11426
 
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
11427
 
}
11428
 
 
11429
 
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
11430
 
    const signed int neg_one = (signed int)-1, const_zero = 0;
11431
 
    const int is_unsigned = neg_one > const_zero;
11432
 
    if (sizeof(signed int) < sizeof(long)) {
11433
 
        long val = __Pyx_PyInt_AsLong(x);
11434
 
        if (unlikely(val != (long)(signed int)val)) {
11435
 
            if (!unlikely(val == -1 && PyErr_Occurred())) {
11436
 
                PyErr_SetString(PyExc_OverflowError,
11437
 
                    (is_unsigned && unlikely(val < 0)) ?
11438
 
                    "can't convert negative value to signed int" :
11439
 
                    "value too large to convert to signed int");
11440
 
            }
11441
 
            return (signed int)-1;
11442
 
        }
11443
 
        return (signed int)val;
11444
 
    }
11445
 
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
11446
 
}
11447
 
 
11448
 
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
11449
 
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
11450
 
    const int is_unsigned = neg_one > const_zero;
11451
 
#if PY_VERSION_HEX < 0x03000000
11452
 
    if (likely(PyInt_Check(x))) {
11453
 
        long val = PyInt_AS_LONG(x);
11454
 
        if (is_unsigned && unlikely(val < 0)) {
11455
 
            PyErr_SetString(PyExc_OverflowError,
11456
 
                            "can't convert negative value to unsigned long");
11457
 
            return (unsigned long)-1;
11458
 
        }
11459
 
        return (unsigned long)val;
11460
 
    } else
11461
 
#endif
11462
 
    if (likely(PyLong_Check(x))) {
11463
 
        if (is_unsigned) {
11464
 
            if (unlikely(Py_SIZE(x) < 0)) {
11465
 
                PyErr_SetString(PyExc_OverflowError,
11466
 
                                "can't convert negative value to unsigned long");
11467
 
                return (unsigned long)-1;
11468
 
            }
11469
 
            return PyLong_AsUnsignedLong(x);
11470
 
        } else {
11471
 
            return PyLong_AsLong(x);
11472
 
        }
11473
 
    } else {
11474
 
        unsigned long val;
11475
 
        PyObject *tmp = __Pyx_PyNumber_Int(x);
11476
 
        if (!tmp) return (unsigned long)-1;
11477
 
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
11478
 
        Py_DECREF(tmp);
11479
 
        return val;
11480
 
    }
11481
 
}
11482
 
 
11483
 
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
11484
 
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
11485
 
    const int is_unsigned = neg_one > const_zero;
11486
 
#if PY_VERSION_HEX < 0x03000000
11487
 
    if (likely(PyInt_Check(x))) {
11488
 
        long val = PyInt_AS_LONG(x);
11489
 
        if (is_unsigned && unlikely(val < 0)) {
11490
 
            PyErr_SetString(PyExc_OverflowError,
11491
 
                            "can't convert negative value to unsigned PY_LONG_LONG");
11492
 
            return (unsigned PY_LONG_LONG)-1;
11493
 
        }
11494
 
        return (unsigned PY_LONG_LONG)val;
11495
 
    } else
11496
 
#endif
11497
 
    if (likely(PyLong_Check(x))) {
11498
 
        if (is_unsigned) {
11499
 
            if (unlikely(Py_SIZE(x) < 0)) {
11500
 
                PyErr_SetString(PyExc_OverflowError,
11501
 
                                "can't convert negative value to unsigned PY_LONG_LONG");
11502
 
                return (unsigned PY_LONG_LONG)-1;
11503
 
            }
11504
 
            return PyLong_AsUnsignedLongLong(x);
11505
 
        } else {
11506
 
            return PyLong_AsLongLong(x);
11507
 
        }
11508
 
    } else {
11509
 
        unsigned PY_LONG_LONG val;
11510
 
        PyObject *tmp = __Pyx_PyNumber_Int(x);
11511
 
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
11512
 
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
11513
 
        Py_DECREF(tmp);
11514
 
        return val;
11515
 
    }
11516
 
}
11517
 
 
11518
 
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
11519
 
    const long neg_one = (long)-1, const_zero = 0;
11520
 
    const int is_unsigned = neg_one > const_zero;
11521
 
#if PY_VERSION_HEX < 0x03000000
11522
 
    if (likely(PyInt_Check(x))) {
11523
 
        long val = PyInt_AS_LONG(x);
11524
 
        if (is_unsigned && unlikely(val < 0)) {
11525
 
            PyErr_SetString(PyExc_OverflowError,
11526
 
                            "can't convert negative value to long");
11527
 
            return (long)-1;
11528
 
        }
11529
 
        return (long)val;
11530
 
    } else
11531
 
#endif
11532
 
    if (likely(PyLong_Check(x))) {
11533
 
        if (is_unsigned) {
11534
 
            if (unlikely(Py_SIZE(x) < 0)) {
11535
 
                PyErr_SetString(PyExc_OverflowError,
11536
 
                                "can't convert negative value to long");
11537
 
                return (long)-1;
11538
 
            }
11539
 
            return PyLong_AsUnsignedLong(x);
11540
 
        } else {
11541
 
            return PyLong_AsLong(x);
11542
 
        }
11543
 
    } else {
11544
 
        long val;
11545
 
        PyObject *tmp = __Pyx_PyNumber_Int(x);
11546
 
        if (!tmp) return (long)-1;
11547
 
        val = __Pyx_PyInt_AsLong(tmp);
11548
 
        Py_DECREF(tmp);
11549
 
        return val;
11550
 
    }
11551
 
}
11552
 
 
11553
 
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
11554
 
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
11555
 
    const int is_unsigned = neg_one > const_zero;
11556
 
#if PY_VERSION_HEX < 0x03000000
11557
 
    if (likely(PyInt_Check(x))) {
11558
 
        long val = PyInt_AS_LONG(x);
11559
 
        if (is_unsigned && unlikely(val < 0)) {
11560
 
            PyErr_SetString(PyExc_OverflowError,
11561
 
                            "can't convert negative value to PY_LONG_LONG");
11562
 
            return (PY_LONG_LONG)-1;
11563
 
        }
11564
 
        return (PY_LONG_LONG)val;
11565
 
    } else
11566
 
#endif
11567
 
    if (likely(PyLong_Check(x))) {
11568
 
        if (is_unsigned) {
11569
 
            if (unlikely(Py_SIZE(x) < 0)) {
11570
 
                PyErr_SetString(PyExc_OverflowError,
11571
 
                                "can't convert negative value to PY_LONG_LONG");
11572
 
                return (PY_LONG_LONG)-1;
11573
 
            }
11574
 
            return PyLong_AsUnsignedLongLong(x);
11575
 
        } else {
11576
 
            return PyLong_AsLongLong(x);
11577
 
        }
11578
 
    } else {
11579
 
        PY_LONG_LONG val;
11580
 
        PyObject *tmp = __Pyx_PyNumber_Int(x);
11581
 
        if (!tmp) return (PY_LONG_LONG)-1;
11582
 
        val = __Pyx_PyInt_AsLongLong(tmp);
11583
 
        Py_DECREF(tmp);
11584
 
        return val;
11585
 
    }
11586
 
}
11587
 
 
11588
 
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
11589
 
    const signed long neg_one = (signed long)-1, const_zero = 0;
11590
 
    const int is_unsigned = neg_one > const_zero;
11591
 
#if PY_VERSION_HEX < 0x03000000
11592
 
    if (likely(PyInt_Check(x))) {
11593
 
        long val = PyInt_AS_LONG(x);
11594
 
        if (is_unsigned && unlikely(val < 0)) {
11595
 
            PyErr_SetString(PyExc_OverflowError,
11596
 
                            "can't convert negative value to signed long");
11597
 
            return (signed long)-1;
11598
 
        }
11599
 
        return (signed long)val;
11600
 
    } else
11601
 
#endif
11602
 
    if (likely(PyLong_Check(x))) {
11603
 
        if (is_unsigned) {
11604
 
            if (unlikely(Py_SIZE(x) < 0)) {
11605
 
                PyErr_SetString(PyExc_OverflowError,
11606
 
                                "can't convert negative value to signed long");
11607
 
                return (signed long)-1;
11608
 
            }
11609
 
            return PyLong_AsUnsignedLong(x);
11610
 
        } else {
11611
 
            return PyLong_AsLong(x);
11612
 
        }
11613
 
    } else {
11614
 
        signed long val;
11615
 
        PyObject *tmp = __Pyx_PyNumber_Int(x);
11616
 
        if (!tmp) return (signed long)-1;
11617
 
        val = __Pyx_PyInt_AsSignedLong(tmp);
11618
 
        Py_DECREF(tmp);
11619
 
        return val;
11620
 
    }
11621
 
}
11622
 
 
11623
 
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
11624
 
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
11625
 
    const int is_unsigned = neg_one > const_zero;
11626
 
#if PY_VERSION_HEX < 0x03000000
11627
 
    if (likely(PyInt_Check(x))) {
11628
 
        long val = PyInt_AS_LONG(x);
11629
 
        if (is_unsigned && unlikely(val < 0)) {
11630
 
            PyErr_SetString(PyExc_OverflowError,
11631
 
                            "can't convert negative value to signed PY_LONG_LONG");
11632
 
            return (signed PY_LONG_LONG)-1;
11633
 
        }
11634
 
        return (signed PY_LONG_LONG)val;
11635
 
    } else
11636
 
#endif
11637
 
    if (likely(PyLong_Check(x))) {
11638
 
        if (is_unsigned) {
11639
 
            if (unlikely(Py_SIZE(x) < 0)) {
11640
 
                PyErr_SetString(PyExc_OverflowError,
11641
 
                                "can't convert negative value to signed PY_LONG_LONG");
11642
 
                return (signed PY_LONG_LONG)-1;
11643
 
            }
11644
 
            return PyLong_AsUnsignedLongLong(x);
11645
 
        } else {
11646
 
            return PyLong_AsLongLong(x);
11647
 
        }
11648
 
    } else {
11649
 
        signed PY_LONG_LONG val;
11650
 
        PyObject *tmp = __Pyx_PyNumber_Int(x);
11651
 
        if (!tmp) return (signed PY_LONG_LONG)-1;
11652
 
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
11653
 
        Py_DECREF(tmp);
11654
 
        return val;
11655
 
    }
11656
 
}
11657
 
 
11658
 
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
11659
 
#if PY_VERSION_HEX < 0x03010000
11660
 
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
11661
 
#else
11662
 
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
11663
 
#endif
11664
 
    if (!ob)
11665
 
        goto bad;
11666
 
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
11667
 
        goto bad;
11668
 
    Py_DECREF(ob);
11669
 
    return 0;
11670
 
bad:
11671
 
    Py_XDECREF(ob);
11672
 
    return -1;
11673
 
}
11674
 
 
11675
 
#include "compile.h"
11676
 
#include "frameobject.h"
11677
 
#include "traceback.h"
11678
 
 
11679
 
static void __Pyx_AddTraceback(const char *funcname) {
11680
 
    PyObject *py_srcfile = 0;
11681
 
    PyObject *py_funcname = 0;
11682
 
    PyObject *py_globals = 0;
11683
 
    PyCodeObject *py_code = 0;
11684
 
    PyFrameObject *py_frame = 0;
11685
 
 
11686
 
    #if PY_MAJOR_VERSION < 3
11687
 
    py_srcfile = PyString_FromString(__pyx_filename);
11688
 
    #else
11689
 
    py_srcfile = PyUnicode_FromString(__pyx_filename);
11690
 
    #endif
11691
 
    if (!py_srcfile) goto bad;
11692
 
    if (__pyx_clineno) {
11693
 
        #if PY_MAJOR_VERSION < 3
11694
 
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
11695
 
        #else
11696
 
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
11697
 
        #endif
11698
 
    }
11699
 
    else {
11700
 
        #if PY_MAJOR_VERSION < 3
11701
 
        py_funcname = PyString_FromString(funcname);
11702
 
        #else
11703
 
        py_funcname = PyUnicode_FromString(funcname);
11704
 
        #endif
11705
 
    }
11706
 
    if (!py_funcname) goto bad;
11707
 
    py_globals = PyModule_GetDict(__pyx_m);
11708
 
    if (!py_globals) goto bad;
11709
 
    py_code = PyCode_New(
11710
 
        0,            /*int argcount,*/
11711
 
        #if PY_MAJOR_VERSION >= 3
11712
 
        0,            /*int kwonlyargcount,*/
11713
 
        #endif
11714
 
        0,            /*int nlocals,*/
11715
 
        0,            /*int stacksize,*/
11716
 
        0,            /*int flags,*/
11717
 
        __pyx_empty_bytes, /*PyObject *code,*/
11718
 
        __pyx_empty_tuple,  /*PyObject *consts,*/
11719
 
        __pyx_empty_tuple,  /*PyObject *names,*/
11720
 
        __pyx_empty_tuple,  /*PyObject *varnames,*/
11721
 
        __pyx_empty_tuple,  /*PyObject *freevars,*/
11722
 
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
11723
 
        py_srcfile,   /*PyObject *filename,*/
11724
 
        py_funcname,  /*PyObject *name,*/
11725
 
        __pyx_lineno,   /*int firstlineno,*/
11726
 
        __pyx_empty_bytes  /*PyObject *lnotab*/
11727
 
    );
11728
 
    if (!py_code) goto bad;
11729
 
    py_frame = PyFrame_New(
11730
 
        PyThreadState_GET(), /*PyThreadState *tstate,*/
11731
 
        py_code,             /*PyCodeObject *code,*/
11732
 
        py_globals,          /*PyObject *globals,*/
11733
 
        0                    /*PyObject *locals*/
11734
 
    );
11735
 
    if (!py_frame) goto bad;
11736
 
    py_frame->f_lineno = __pyx_lineno;
11737
 
    PyTraceBack_Here(py_frame);
11738
 
bad:
11739
 
    Py_XDECREF(py_srcfile);
11740
 
    Py_XDECREF(py_funcname);
11741
 
    Py_XDECREF(py_code);
11742
 
    Py_XDECREF(py_frame);
11743
 
}
11744
 
 
11745
 
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
11746
 
    while (t->p) {
11747
 
        #if PY_MAJOR_VERSION < 3
11748
 
        if (t->is_unicode) {
11749
 
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
11750
 
        } else if (t->intern) {
11751
 
            *t->p = PyString_InternFromString(t->s);
11752
 
        } else {
11753
 
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
11754
 
        }
11755
 
        #else  /* Python 3+ has unicode identifiers */
11756
 
        if (t->is_unicode | t->is_str) {
11757
 
            if (t->intern) {
11758
 
                *t->p = PyUnicode_InternFromString(t->s);
11759
 
            } else if (t->encoding) {
11760
 
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
11761
 
            } else {
11762
 
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
11763
 
            }
11764
 
        } else {
11765
 
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
11766
 
        }
11767
 
        #endif
11768
 
        if (!*t->p)
11769
 
            return -1;
11770
 
        ++t;
11771
 
    }
11772
 
    return 0;
11773
 
}
11774
 
 
11775
 
/* Type Conversion Functions */
11776
 
 
11777
 
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
11778
 
   if (x == Py_True) return 1;
11779
 
   else if ((x == Py_False) | (x == Py_None)) return 0;
11780
 
   else return PyObject_IsTrue(x);
11781
 
}
11782
 
 
11783
 
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
11784
 
  PyNumberMethods *m;
11785
 
  const char *name = NULL;
11786
 
  PyObject *res = NULL;
11787
 
#if PY_VERSION_HEX < 0x03000000
11788
 
  if (PyInt_Check(x) || PyLong_Check(x))
11789
 
#else
11790
 
  if (PyLong_Check(x))
11791
 
#endif
11792
 
    return Py_INCREF(x), x;
11793
 
  m = Py_TYPE(x)->tp_as_number;
11794
 
#if PY_VERSION_HEX < 0x03000000
11795
 
  if (m && m->nb_int) {
11796
 
    name = "int";
11797
 
    res = PyNumber_Int(x);
11798
 
  }
11799
 
  else if (m && m->nb_long) {
11800
 
    name = "long";
11801
 
    res = PyNumber_Long(x);
11802
 
  }
11803
 
#else
11804
 
  if (m && m->nb_int) {
11805
 
    name = "int";
11806
 
    res = PyNumber_Long(x);
11807
 
  }
11808
 
#endif
11809
 
  if (res) {
11810
 
#if PY_VERSION_HEX < 0x03000000
11811
 
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
11812
 
#else
11813
 
    if (!PyLong_Check(res)) {
11814
 
#endif
11815
 
      PyErr_Format(PyExc_TypeError,
11816
 
                   "__%s__ returned non-%s (type %.200s)",
11817
 
                   name, name, Py_TYPE(res)->tp_name);
11818
 
      Py_DECREF(res);
11819
 
      return NULL;
11820
 
    }
11821
 
  }
11822
 
  else if (!PyErr_Occurred()) {
11823
 
    PyErr_SetString(PyExc_TypeError,
11824
 
                    "an integer is required");
11825
 
  }
11826
 
  return res;
11827
 
}
11828
 
 
11829
 
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
11830
 
  Py_ssize_t ival;
11831
 
  PyObject* x = PyNumber_Index(b);
11832
 
  if (!x) return -1;
11833
 
  ival = PyInt_AsSsize_t(x);
11834
 
  Py_DECREF(x);
11835
 
  return ival;
11836
 
}
11837
 
 
11838
 
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
11839
 
#if PY_VERSION_HEX < 0x02050000
11840
 
   if (ival <= LONG_MAX)
11841
 
       return PyInt_FromLong((long)ival);
11842
 
   else {
11843
 
       unsigned char *bytes = (unsigned char *) &ival;
11844
 
       int one = 1; int little = (int)*(unsigned char*)&one;
11845
 
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
11846
 
   }
11847
 
#else
11848
 
   return PyInt_FromSize_t(ival);
11849
 
#endif
11850
 
}
11851
 
 
11852
 
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
11853
 
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
11854
 
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
11855
 
       return (size_t)-1;
11856
 
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
11857
 
       PyErr_SetString(PyExc_OverflowError,
11858
 
                       "value too large to convert to size_t");
11859
 
       return (size_t)-1;
11860
 
   }
11861
 
   return (size_t)val;
11862
 
}
11863
 
 
11864
 
 
11865
 
#endif /* Py_PYTHON_H */