tlslite.integration.asyncstatemachine module
A state machine for using TLS Lite with asynchronous I/O.
- class tlslite.integration.asyncstatemachine.AsyncStateMachine[source]
Bases:
object
This is an abstract class that’s used to integrate TLS Lite with asyncore and Twisted.
This class signals wantsReadsEvent() and wantsWriteEvent(). When the underlying socket has become readable or writeable, the event should be passed to this class by calling inReadEvent() or inWriteEvent(). This class will then try to read or write through the socket, and will update its state appropriately.
This class will forward higher-level events to its subclass. For example, when a complete TLS record has been received, outReadEvent() will be called with the decrypted data.
- outConnectEvent()[source]
Called when a handshake operation completes.
May be overridden in subclass.
- outReadEvent(readBuffer)[source]
Called when a read operation completes.
May be overridden in subclass.
- setHandshakeOp(handshaker)[source]
Start a handshake operation.
- Parameters:
handshaker (generator) – A generator created by using one of the asynchronous handshake functions (i.e.
handshakeServerAsync()
, or handshakeClientxxx(…, async_=True).
- setServerHandshakeOp(**args)[source]
Start a handshake operation.
The arguments passed to this function will be forwarded to
handshakeServerAsync
.
- setWriteOp(writeBuffer)[source]
Start a write operation.
- Parameters:
writeBuffer (str) – The string to transmit.