Mercury2 Hardware Manager  1.0dev
The hardware manager component of the Mercury2 ground station suite.
 All Classes Namespaces Functions Variables Pages
hwm.network.protocols.utilities Namespace Reference

Contains methods commonly used by the HWM network protocols. More...

Functions

def load_session_after_tls_handshake
 Loads the requested session once the provided Protocol's TLS handshake is complete. More...
 

Detailed Description

Contains methods commonly used by the HWM network protocols.

Function Documentation

def hwm.network.protocols.utilities.load_session_after_tls_handshake (   protocol)

Loads the requested session once the provided Protocol's TLS handshake is complete.

This function periodically checks if the specified protocol's transport has completed its TLS handshake using the reactor.callLater() utility. This is required because connectionMade() method is typically called before the TLS handshake has been completed. Once the handshake is complete, this function will load the requested session and return it via a deferred.

Note
This function uses the clients's TLS certificate's common name field to determine what session it should load. If the requested session is not yet active, the connection will be terminated.
Todo:
This method should probably wait if a user connects a few minutes before their session begins instead of immediately disconnecting.
Parameters
protocolThe Protocol that wants to wait for its TLS handshake to complete.
Returns
This function returns a deferred that will eventually be fired with the loaded session. If the session can't be located, the deferred will errback.