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