XRootD
XrdCl::TransportHandler Class Referenceabstract

Perform the handshake and the authentication for each physical stream. More...

#include <XrdClPostMasterInterfaces.hh>

+ Inheritance diagram for XrdCl::TransportHandler:
+ Collaboration diagram for XrdCl::TransportHandler:

Public Types

enum  StreamAction {
  NoAction = 0x0000 ,
  DigestMsg = 0x0001 ,
  AbortStream = 0x0002 ,
  CloseStream = 0x0004 ,
  ResumeStream = 0x0008 ,
  HoldStream = 0x0010 ,
  RequestClose = 0x0020
}
 Stream actions that may be triggered by incoming control messages. More...
 

Public Member Functions

virtual ~TransportHandler ()
 
virtual void DecFileInstCnt (AnyObject &channelData)=0
 Decrement file object instance count bound to this channel. More...
 
virtual void Disconnect (AnyObject &channelData, uint16_t subStreamId)=0
 The stream has been disconnected, do the cleanups. More...
 
virtual void FinalizeChannel (AnyObject &channelData)=0
 Finalize channel. More...
 
virtual URL GetBindPreference (const URL &url, AnyObject &channelData)=0
 Get bind preference for the next data stream. More...
 
virtual XRootDStatus GetBody (Message &message, Socket *socket)=0
 
virtual XRootDStatus GetHeader (Message &message, Socket *socket)=0
 
virtual XRootDStatus GetMore (Message &message, Socket *socket)=0
 
virtual Status GetSignature (Message *toSign, Message *&sign, AnyObject &channelData)=0
 Get signature for given message. More...
 
virtual XRootDStatus HandShake (HandShakeData *handShakeData, AnyObject &channelData)=0
 HandHake. More...
 
virtual bool HandShakeDone (HandShakeData *handShakeData, AnyObject &channelData)=0
 
virtual void InitializeChannel (const URL &url, AnyObject &channelData)=0
 Initialize channel. More...
 
virtual Status IsStreamBroken (time_t inactiveTime, AnyObject &channelData)=0
 
virtual bool IsStreamTTLElapsed (time_t inactiveTime, AnyObject &channelData)=0
 Check if the stream should be disconnected. More...
 
virtual uint32_t MessageReceived (Message &msg, uint16_t subStream, AnyObject &channelData)=0
 Check if the message invokes a stream action. More...
 
virtual void MessageSent (Message *msg, uint16_t subStream, uint32_t bytesSent, AnyObject &channelData)=0
 Notify the transport about a message having been sent. More...
 
virtual PathID Multiplex (Message *msg, AnyObject &channelData, PathID *hint=0)=0
 
virtual PathID MultiplexSubStream (Message *msg, AnyObject &channelData, PathID *hint=0)=0
 
virtual bool NeedEncryption (HandShakeData *handShakeData, AnyObject &channelData)=0
 
virtual Status Query (uint16_t query, AnyObject &result, AnyObject &channelData)=0
 Query the channel. More...
 
virtual uint16_t SubStreamNumber (AnyObject &channelData)=0
 Return a number of substreams per stream that should be created. More...
 
virtual void WaitBeforeExit ()=0
 Wait before exit. More...
 

Detailed Description

Perform the handshake and the authentication for each physical stream.

Definition at line 309 of file XrdClPostMasterInterfaces.hh.

Member Enumeration Documentation

◆ StreamAction

Stream actions that may be triggered by incoming control messages.

Enumerator
NoAction 

No action.

DigestMsg 

Digest the incoming message so that it won't be passed to the user handlers

AbortStream 

Disconnect, abort all the on-going operations and mark the stream as permanently broken [not yet implemented]

CloseStream 

Disconnect and attempt reconnection later [not yet implemented]

ResumeStream 

Resume sending requests [not yet implemented]

HoldStream 

Stop sending requests [not yet implemented].

RequestClose 

Send a close request.

Definition at line 316 of file XrdClPostMasterInterfaces.hh.

317  {
318  NoAction = 0x0000,
319  DigestMsg = 0x0001,
321  AbortStream = 0x0002,
324  CloseStream = 0x0004,
326  ResumeStream = 0x0008,
328  HoldStream = 0x0010,
329  RequestClose = 0x0020
330  };
@ RequestClose
Send a close request.
@ HoldStream
Stop sending requests [not yet implemented].

Constructor & Destructor Documentation

◆ ~TransportHandler()

virtual XrdCl::TransportHandler::~TransportHandler ( )
inlinevirtual

Definition at line 333 of file XrdClPostMasterInterfaces.hh.

333 {}

Member Function Documentation

◆ DecFileInstCnt()

virtual void XrdCl::TransportHandler::DecFileInstCnt ( AnyObject channelData)
pure virtual

Decrement file object instance count bound to this channel.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Channel::DecFileInstCnt().

+ Here is the caller graph for this function:

◆ Disconnect()

virtual void XrdCl::TransportHandler::Disconnect ( AnyObject channelData,
uint16_t  subStreamId 
)
pure virtual

The stream has been disconnected, do the cleanups.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncSocketHandler::Close().

+ Here is the caller graph for this function:

◆ FinalizeChannel()

virtual void XrdCl::TransportHandler::FinalizeChannel ( AnyObject channelData)
pure virtual

Finalize channel.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Channel::~Channel().

+ Here is the caller graph for this function:

◆ GetBindPreference()

virtual URL XrdCl::TransportHandler::GetBindPreference ( const URL url,
AnyObject channelData 
)
pure virtual

Get bind preference for the next data stream.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnConnect().

+ Here is the caller graph for this function:

◆ GetBody()

virtual XRootDStatus XrdCl::TransportHandler::GetBody ( Message message,
Socket socket 
)
pure virtual

Read the message body from the socket, the socket is non-blocking, the method may be called multiple times - see GetHeader for details

Parameters
messagethe message buffer containing the header
socketthe socket
Returns
stOK & suDone if the whole message has been processed stOK & suRetry if more data is needed stError on failure

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncHSReader::Read(), and XrdCl::AsyncMsgReader::Read().

+ Here is the caller graph for this function:

◆ GetHeader()

virtual XRootDStatus XrdCl::TransportHandler::GetHeader ( Message message,
Socket socket 
)
pure virtual

Read a message header from the socket, the socket is non-blocking, so if there is not enough data the function should return errRetry in which case it will be called again when more data arrives, with the data previously read stored in the message buffer

Parameters
messagethe message buffer
socketthe socket
Returns
stOK & suDone if the whole message has been processed stOK & suRetry if more data is needed stError on failure

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncHSReader::Read(), and XrdCl::AsyncMsgReader::Read().

+ Here is the caller graph for this function:

◆ GetMore()

virtual XRootDStatus XrdCl::TransportHandler::GetMore ( Message message,
Socket socket 
)
pure virtual

Read more of the message body from the socket, the socket is non-blocking the method may be called multiple times - see GetHeader for details

Parameters
messagethe message buffer containing the header
socketthe socket
Returns
stOK & suDone if the whole message has been processed stOK & suRetry if more data is needed stError on failure

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncMsgReader::Read().

+ Here is the caller graph for this function:

◆ GetSignature()

virtual Status XrdCl::TransportHandler::GetSignature ( Message toSign,
Message *&  sign,
AnyObject channelData 
)
pure virtual

Get signature for given message.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncMsgWriter::Write().

+ Here is the caller graph for this function:

◆ HandShake()

virtual XRootDStatus XrdCl::TransportHandler::HandShake ( HandShakeData handShakeData,
AnyObject channelData 
)
pure virtual

HandHake.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncSocketHandler::HandleHandShake(), and XrdCl::AsyncSocketHandler::OnConnectionReturn().

+ Here is the caller graph for this function:

◆ HandShakeDone()

virtual bool XrdCl::TransportHandler::HandShakeDone ( HandShakeData handShakeData,
AnyObject channelData 
)
pure virtual

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncSocketHandler::OnTLSHandShake().

+ Here is the caller graph for this function:

◆ InitializeChannel()

virtual void XrdCl::TransportHandler::InitializeChannel ( const URL url,
AnyObject channelData 
)
pure virtual

Initialize channel.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Channel::Channel().

+ Here is the caller graph for this function:

◆ IsStreamBroken()

virtual Status XrdCl::TransportHandler::IsStreamBroken ( time_t  inactiveTime,
AnyObject channelData 
)
pure virtual

Check the stream is broken - ie. TCP connection got broken and went undetected by the TCP stack

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnReadTimeout().

+ Here is the caller graph for this function:

◆ IsStreamTTLElapsed()

virtual bool XrdCl::TransportHandler::IsStreamTTLElapsed ( time_t  inactiveTime,
AnyObject channelData 
)
pure virtual

Check if the stream should be disconnected.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnReadTimeout().

+ Here is the caller graph for this function:

◆ MessageReceived()

virtual uint32_t XrdCl::TransportHandler::MessageReceived ( Message msg,
uint16_t  subStream,
AnyObject channelData 
)
pure virtual

Check if the message invokes a stream action.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnIncoming().

+ Here is the caller graph for this function:

◆ MessageSent()

virtual void XrdCl::TransportHandler::MessageSent ( Message msg,
uint16_t  subStream,
uint32_t  bytesSent,
AnyObject channelData 
)
pure virtual

Notify the transport about a message having been sent.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnMessageSent().

+ Here is the caller graph for this function:

◆ Multiplex()

virtual PathID XrdCl::TransportHandler::Multiplex ( Message msg,
AnyObject channelData,
PathID hint = 0 
)
pure virtual

Return the ID for the up stream this message should be sent by and the down stream which the answer should be expected at. Modify the message itself if necessary. If hint is non-zero then the message should be modified such that the answer will be returned via the hinted stream.

Implemented in XrdCl::XRootDTransport.

◆ MultiplexSubStream()

virtual PathID XrdCl::TransportHandler::MultiplexSubStream ( Message msg,
AnyObject channelData,
PathID hint = 0 
)
pure virtual

Return the ID for the up substream this message should be sent by and the down substream which the answer should be expected at. Modify the message itself if necessary. If hint is non-zero then the message should be modified such that the answer will be returned via the hinted stream.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::Send().

+ Here is the caller graph for this function:

◆ NeedEncryption()

virtual bool XrdCl::TransportHandler::NeedEncryption ( HandShakeData handShakeData,
AnyObject channelData 
)
pure virtual
Returns
: true if encryption should be turned on, false otherwise

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::AsyncSocketHandler::HandleHandShake().

+ Here is the caller graph for this function:

◆ Query()

virtual Status XrdCl::TransportHandler::Query ( uint16_t  query,
AnyObject result,
AnyObject channelData 
)
pure virtual

Query the channel.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnConnect(), and XrdCl::Channel::QueryTransport().

+ Here is the caller graph for this function:

◆ SubStreamNumber()

virtual uint16_t XrdCl::TransportHandler::SubStreamNumber ( AnyObject channelData)
pure virtual

Return a number of substreams per stream that should be created.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::Stream::OnConnect().

+ Here is the caller graph for this function:

◆ WaitBeforeExit()

virtual void XrdCl::TransportHandler::WaitBeforeExit ( )
pure virtual

Wait before exit.

Implemented in XrdCl::XRootDTransport.

Referenced by XrdCl::PluginUnloadHandler::UnloadHandler().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: