Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
multiprocessing.connection.SocketListener Class Reference
Inheritance diagram for multiprocessing.connection.SocketListener:
Inheritance graph
[legend]
Collaboration diagram for multiprocessing.connection.SocketListener:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def accept
def close

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Attributes

 _socket
 _address
 _family
 _last_accepted
 _unlink

Detailed Description

Representation of a socket which is bound to an address and listening

Definition at line 246 of file connection.py.


Constructor & Destructor Documentation

def multiprocessing.connection.SocketListener.__init__ (   self,
  address,
  family,
  backlog = 1 
)

Definition at line 250 of file connection.py.

00250 
00251     def __init__(self, address, family, backlog=1):
00252         self._socket = socket.socket(getattr(socket, family))
00253         self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
00254         self._socket.bind(address)
00255         self._socket.listen(backlog)
00256         self._address = self._socket.getsockname()
00257         self._family = family
00258         self._last_accepted = None
00259 
00260         if family == 'AF_UNIX':
00261             self._unlink = Finalize(
00262                 self, os.unlink, args=(address,), exitpriority=0
00263                 )
00264         else:
00265             self._unlink = None

Here is the caller graph for this function:


Member Function Documentation

Definition at line 266 of file connection.py.

00266 
00267     def accept(self):
00268         s, self._last_accepted = self._socket.accept()
00269         fd = duplicate(s.fileno())
00270         conn = _multiprocessing.Connection(fd)
00271         s.close()
00272         return conn

Definition at line 273 of file connection.py.

00273 
00274     def close(self):
00275         self._socket.close()
00276         if self._unlink is not None:
00277             self._unlink()
00278 

Here is the caller graph for this function:


Member Data Documentation

Definition at line 255 of file connection.py.

Definition at line 256 of file connection.py.

Definition at line 257 of file connection.py.

Definition at line 251 of file connection.py.

Definition at line 260 of file connection.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: