Package wtf :: Package opi :: Module listener :: Class ListenerSocket
[hide private]
[frames] | no frames]

Class ListenerSocket

source code

object --+
         |
        ListenerSocket

Abstraction to the listener socket

This actually can contain more than one actual socket, but provides an interface as it was one.

Instance Methods [hide private]
 
__init__(self, listen, basedir=None)
Initialization
source code
callable
_finalize_listeners(self, msg)
Finalize the listening sockets
source code
 
__del__(self) source code
 
close(self)
Shutdown the sockets
source code
 
_setup_tcp(self, bind, basedir=None)
Setup TCP/IP(v6) socket and append it to the global list
source code
 
_setup_unix(self, bind, basedir=None)
Setup UNIX domain socket
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
tuple _TYPES = ((u'tcp', (re.compile(r'(?:(?P<ip>[^:]+|\[[^\]]+\]|\*...
Supported socket types and configuration patterns ((('name', (regex, ...)), ...))
Instance Variables [hide private]
list _sockets = None
List of actual sockets ([socket, ...])
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, listen, basedir=None)
(Constructor)

source code 
Initialization
Parameters:
  • listen (iterable) - The addresses to listen on, may not be empty
  • basedir (str) - Basedir for relative paths
Overrides: object.__init__

_finalize_listeners(self, msg)

source code 

Finalize the listening sockets

This method actually sets the sockets to the LISTEN state.

Parameters:
  • msg (str) - Configuration error message template
Returns: callable
Socket acceptor
Raises:

_setup_tcp(self, bind, basedir=None)

source code 
Setup TCP/IP(v6) socket and append it to the global list
Parameters:
  • bind (callable) - Bind parameter accessor (match.group)
  • basedir (basestring) - Basedir for relative paths (unused)

_setup_unix(self, bind, basedir=None)

source code 
Setup UNIX domain socket
Parameters:
  • bind (callable) - Bind parameter accessor (match.group)
  • basedir (str) - Basedir for relative paths

Class Variable Details [hide private]

_TYPES

Supported socket types and configuration patterns ((('name', (regex, ...)), ...))
Type:
tuple
Value:
((u'tcp',
  (re.compile(r'(?:(?P<ip>[^:]+|\[[^\]]+\]|\*):)?(?P<port>\d+)$'))),
 (u'unix',
  (re.compile(r'(?P<path>.+)\((?P<perm>\d+)\)$'),
   re.compile(r'(?P<path>.+)(?P<perm>)$'))))