crossbar.common.twisted.sharedport

Classes

CustomTCPPort

A custom TCP port which allows to set socket options for sharing TCP ports between multiple processes.

CustomTCPTLSPort

A custom TLS port which allows to set socket options for sharing (the underlying) TCP ports between multiple processes.

Functions

create_stream_socket(addressFamily[, shared])

Create a new socket for use with Twisted's IReactor.adoptStreamPort.

Module Contents

class CustomTCPPort(port, factory, backlog=50, interface='', reactor=None, shared=False, user_timeout=None)[source]

Bases: twisted.internet.tcp.Port

A custom TCP port which allows to set socket options for sharing TCP ports between multiple processes.

createInternetSocket()[source]
class CustomTCPTLSPort(port, factory, ctxFactory, backlog=50, interface='', reactor=None, shared=False, user_timeout=None)[source]

Bases: CustomTCPPort, twisted.internet.ssl.Port

A custom TLS port which allows to set socket options for sharing (the underlying) TCP ports between multiple processes.

create_stream_socket(addressFamily, shared=False)[source]

Create a new socket for use with Twisted’s IReactor.adoptStreamPort.

Parameters:
  • addressFamily (One of socket.AF_INET, socket.AF_INET6, socket.AF_UNIX) – The socket address family.

  • shared (bool) – If True, request to create a shared, load-balanced socket. When this feature is not available, throw an exception.

:returns obj – A socket.