BaseTransport

Hosts BaseTransport class, which is a base for PlainTransport and SSLTransport

BaseTransport is used by the client and the service, it describes an opened connection. Here a diagram of basic Client/Service exchange

Client -> ServiceReactor : Connect

Client<–>Service : Handshake (only in SSLTransport)

Client -> Service : Propose action

Client <- Service : S_OK

Client -> RequestHandler : Arguments

Client <- RequestHandler : Response

Client <- Service : Close

class DIRAC.Core.DISET.private.Transports.BaseTransport.BaseTransport(stServerAddress, bServerMode=False, **kwargs)

Bases: object

Invokes DEncode for marshaling/unmarshaling of data calls in transit

__init__(stServerAddress, bServerMode=False, **kwargs)

x.__init__(…) initializes x; see help(type(x)) for signature

bAllowReuseAddress = True
close()
getAppData()
getConnectingCredentials()
Returns:dictionnary with credentials

Return empty dictionnary for plainTransport.

In SSLTransport it contains (after the handshake):
  • ’DN’ : All identity name, e.g. `/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser/emailAddress=lhcb-dirac-ci@cern.ch`
  • ’CN’ : Only the user name e.g. ciuser
  • ’x509Chain’ : List of all certificates in the chain
  • ’isProxy’ : True if the client use proxy certificate
  • ’isLimitedProxy’ : True if the client use limited proxy certificate
  • ’group’ (optional): Dirac group attached to the client
  • ’extraCredentials’ (optional): Extra credentials if exists

Before the handshake, dictionnary is empty

getFormattedCredentials()
getKeepAliveLapse()
getLastActionTimestamp()
getLocalAddress()
getRemoteAddress()
getSocket()
handshake()

This method is overwritten by SSLTransport if we use a secured transport.

iListenQueueSize = 5
iReadTimeout = 600
keepAliveMagic = 'dka'
latestServerRenewTime()
receiveData(maxBufferSize=0, blockAfterKeepAlive=True, idleReceive=False)
renewServerContext()
sendData(uData, prefix=False)
sendKeepAlive(responseId=None, now=False)
serverMode()
setAppData(appData)
setExtraCredentials(group)
setSocketTimeout(timeout)

This method has to be overwritten, if we want to increase the socket timeout.