Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Properties | Private Attributes
multiprocessing.connection.Listener Class Reference
Inheritance diagram for multiprocessing.connection.Listener:
Inheritance graph
[legend]
Collaboration diagram for multiprocessing.connection.Listener:
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

Properties

 address = property(lambda self: self._listener._address)
 last_accepted = property(lambda self: self._listener._last_accepted)

Private Attributes

 _listener
 _authkey

Detailed Description

Returns a listener object.

This is a wrapper for a bound socket which is 'listening' for
connections, or for a Windows named pipe.

Definition at line 117 of file connection.py.


Constructor & Destructor Documentation

def multiprocessing.connection.Listener.__init__ (   self,
  address = None,
  family = None,
  backlog = 1,
  authkey = None 
)

Definition at line 124 of file connection.py.

00124 
00125     def __init__(self, address=None, family=None, backlog=1, authkey=None):
00126         family = family or (address and address_type(address)) \
00127                  or default_family
00128         address = address or arbitrary_address(family)
00129 
00130         if family == 'AF_PIPE':
00131             self._listener = PipeListener(address, backlog)
00132         else:
00133             self._listener = SocketListener(address, family, backlog)
00134 
00135         if authkey is not None and not isinstance(authkey, bytes):
00136             raise TypeError('authkey should be a byte string')
00137 
00138         self._authkey = authkey

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Accept a connection on the bound socket or named pipe of `self`.

Returns a `Connection` object.

Reimplemented in multiprocessing.connection.XmlListener.

Definition at line 139 of file connection.py.

00139 
00140     def accept(self):
00141         '''
00142         Accept a connection on the bound socket or named pipe of `self`.
00143 
00144         Returns a `Connection` object.
00145         '''
00146         c = self._listener.accept()
00147         if self._authkey:
00148             deliver_challenge(c, self._authkey)
00149             answer_challenge(c, self._authkey)
00150         return c

Here is the call graph for this function:

Close the bound socket or named pipe of `self`.

Definition at line 151 of file connection.py.

00151 
00152     def close(self):
00153         '''
00154         Close the bound socket or named pipe of `self`.
00155         '''
00156         return self._listener.close()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 137 of file connection.py.

Definition at line 130 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.


Property Documentation

multiprocessing.connection.Listener.address = property(lambda self: self._listener._address) [static]

Definition at line 157 of file connection.py.

multiprocessing.connection.Listener.last_accepted = property(lambda self: self._listener._last_accepted) [static]

Definition at line 158 of file connection.py.


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