socket.pxd revision 781d71db
1"""0MQ Socket class declaration."""
2
3#
4#    Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
5#
6#    This file is part of pyzmq.
7#
8#    pyzmq is free software; you can redistribute it and/or modify it under
9#    the terms of the Lesser GNU General Public License as published by
10#    the Free Software Foundation; either version 3 of the License, or
11#    (at your option) any later version.
12#
13#    pyzmq is distributed in the hope that it will be useful,
14#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16#    Lesser GNU General Public License for more details.
17#
18#    You should have received a copy of the Lesser GNU General Public License
19#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20#
21
22#-----------------------------------------------------------------------------
23# Imports
24#-----------------------------------------------------------------------------
25
26from context cimport Context
27
28#-----------------------------------------------------------------------------
29# Code
30#-----------------------------------------------------------------------------
31
32
33cdef class Socket:
34
35    cdef object __weakref__     # enable weakref
36    cdef void *handle           # The C handle for the underlying zmq object.
37    cdef bint _shadow           # whether the Socket is a shadow wrapper of another
38    # Hold on to a reference to the context to make sure it is not garbage
39    # collected until the socket it done with it.
40    cdef public Context context # The zmq Context object that owns this.
41    cdef public bint _closed    # bool property for a closed socket.
42    cdef int _pid               # the pid of the process which created me (for fork safety)
43
44    # cpdef methods for direct-cython access:
45    cpdef object send(self, object data, int flags=*, copy=*, track=*)
46    cpdef object recv(self, int flags=*, copy=*, track=*)
47
48