Module Contents¶
Functions¶
|
Inline sleep for use in co-routines (Twisted |
|
Return a peer descriptor given a Twisted transport, for example: |
|
|
|
Dummy when no TLS is available. |
Create transport details from Twisted transport. |
Attributes¶
- autobahn.twisted.util._HAS_IPV6 = True¶
- autobahn.twisted.util._HAS_TLS = True¶
- autobahn.twisted.util.__all = ['sleep', 'peer2str', 'transport_channel_id', 'extract_peer_certificate', 'create_transport_details']¶
- autobahn.twisted.util.sleep(delay, reactor=None)[source]¶
Inline sleep for use in co-routines (Twisted
inlineCallback
decorated functions).- Parameters
delay (float) – Time to sleep in seconds.
reactor (None or provider of
IReactorTime
.) – The Twisted reactor to use.
- autobahn.twisted.util.peer2str(transport: Union[twisted.internet.interfaces.ITransport, twisted.internet.interfaces.IProcessTransport]) str [source]¶
Return a peer descriptor given a Twisted transport, for example:
tcp4:127.0.0.1:52914
: a TCPv4 socketunix:/tmp/server.sock
: a Unix domain socketprocess:142092
: a Pipe originating from a spawning (parent) processpipe
: a Pipe terminating in a spawned (child) process
- Returns
Returns a string representation of the peer of the Twisted transport.
- autobahn.twisted.util.transport_channel_id(transport: object, is_server: bool, channel_id_type: Optional[str] = None) Optional[bytes] [source]¶
- autobahn.twisted.util.extract_peer_certificate(transport: object) Optional[Dict[str, Any]] [source]¶
Dummy when no TLS is available.
- Parameters
transport – Ignored.
- Returns
Always return
None
.
- autobahn.twisted.util.create_transport_details(transport: Union[twisted.internet.interfaces.ITransport, twisted.internet.interfaces.IProcessTransport], is_server: bool) autobahn.wamp.types.TransportDetails [source]¶
Create transport details from Twisted transport.
- Parameters
transport – The Twisted transport to extract information from.
is_server – Flag indicating whether this transport side is a “server” (as in TCP server).
- Returns
Transport details object filled with information from the Twisted transport.