xrootd
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
XrdCl::AsyncSocketHandler Class Reference

#include <XrdClAsyncSocketHandler.hh>

Inheritance diagram for XrdCl::AsyncSocketHandler:
Inheritance graph
[legend]
Collaboration diagram for XrdCl::AsyncSocketHandler:
Collaboration graph
[legend]

Public Member Functions

 AsyncSocketHandler (const URL &url, Poller *poller, TransportHandler *transport, AnyObject *channelData, uint16_t subStreamNum, Stream *strm)
 Constructor.
 
 ~AsyncSocketHandler ()
 Destructor.
 
void SetAddress (const XrdNetAddr &address)
 Set address.
 
const XrdNetAddrGetAddress () const
 Get the address that the socket is connected to.
 
XRootDStatus Connect (time_t timeout)
 Connect to the currently set address.
 
XRootDStatus Close ()
 Close the connection.
 
virtual void Event (uint8_t type, XrdCl::Socket *)
 Handle a socket event.
 
XRootDStatus EnableUplink ()
 Enable uplink.
 
XRootDStatus DisableUplink ()
 Disable uplink.
 
const std::string & GetStreamName ()
 Get stream name.
 
time_t GetLastActivity ()
 Get timestamp of last registered socket activity.
 
std::string GetIpStack () const
 Get the IP stack.
 
std::string GetIpAddr ()
 Get IP address.
 
std::string GetHostName ()
 Get hostname.
 
- Public Member Functions inherited from XrdCl::SocketHandler
virtual ~SocketHandler ()
 
virtual void Initialize (Poller *)
 Initializer.
 
virtual void Finalize ()
 Finalizer.
 
virtual void Event (uint8_t type, Socket *socket)=0
 Called when an event occurred on a given socket.
 

Protected Member Functions

virtual void OnConnectionReturn ()
 
void OnWrite ()
 
void OnWriteWhileHandshaking ()
 
void OnRead ()
 
void OnReadWhileHandshaking ()
 
void HandleHandShake (std::unique_ptr< Message > msg)
 
void HandShakeNextStep (bool done)
 
void OnFault (XRootDStatus st)
 
void OnFaultWhileHandshaking (XRootDStatus st)
 
void OnWriteTimeout ()
 
void OnReadTimeout ()
 
void OnTimeoutWhileHandshaking ()
 
void OnHeaderCorruption ()
 
XRootDStatus DoTlsHandShake ()
 
void OnTLSHandShake ()
 
void SendHSMsg ()
 
kXR_int32 HandleWaitRsp (Message *rsp)
 
void CheckHSWait ()
 

Static Protected Member Functions

static std::string ToStreamName (const URL &url, uint16_t strmnb)
 Convert Stream object and sub-stream number to stream name.
 

Protected Attributes

PollerpPoller
 
TransportHandlerpTransport
 
AnyObjectpChannelData
 
uint16_t pSubStreamNum
 
StreampStream
 
std::string pStreamName
 
SocketpSocket
 
XrdNetAddr pSockAddr
 
std::unique_ptr< HandShakeDatapHandShakeData
 
bool pHandShakeDone
 
uint16_t pTimeoutResolution
 
time_t pConnectionStarted
 
time_t pConnectionTimeout
 
time_t pLastActivity
 
time_t pHSWaitStarted
 
time_t pHSWaitSeconds
 
URL pUrl
 
bool pTlsHandShakeOngoing
 
std::unique_ptr< AsyncHSWriterhswriter
 
std::unique_ptr< AsyncMsgReaderrspreader
 
std::unique_ptr< AsyncHSReaderhsreader
 
std::unique_ptr< AsyncMsgWriterreqwriter
 

Additional Inherited Members

- Public Types inherited from XrdCl::SocketHandler
enum  EventType { ReadyToRead = 0x01 , ReadTimeOut = 0x02 , ReadyToWrite = 0x04 , WriteTimeOut = 0x08 }
 Event type. More...
 
- Static Public Member Functions inherited from XrdCl::SocketHandler
static std::string EventTypeToString (uint8_t event)
 Translate the event type to a string.
 

Detailed Description

Utility class handling asynchronous socket interactions and forwarding events to the parent stream.

Constructor & Destructor Documentation

◆ AsyncSocketHandler()

XrdCl::AsyncSocketHandler::AsyncSocketHandler ( const URL url,
Poller poller,
TransportHandler transport,
AnyObject channelData,
uint16_t  subStreamNum,
Stream strm 
)

Constructor.

◆ ~AsyncSocketHandler()

XrdCl::AsyncSocketHandler::~AsyncSocketHandler ( )

Destructor.

Member Function Documentation

◆ CheckHSWait()

void XrdCl::AsyncSocketHandler::CheckHSWait ( )
protected

◆ Close()

XRootDStatus XrdCl::AsyncSocketHandler::Close ( )

Close the connection.

◆ Connect()

XRootDStatus XrdCl::AsyncSocketHandler::Connect ( time_t  timeout)

Connect to the currently set address.

◆ DisableUplink()

XRootDStatus XrdCl::AsyncSocketHandler::DisableUplink ( )
inline

◆ DoTlsHandShake()

XRootDStatus XrdCl::AsyncSocketHandler::DoTlsHandShake ( )
protected

◆ EnableUplink()

XRootDStatus XrdCl::AsyncSocketHandler::EnableUplink ( )
inline

◆ Event()

virtual void XrdCl::AsyncSocketHandler::Event ( uint8_t  type,
XrdCl::Socket  
)
virtual

Handle a socket event.

Implements XrdCl::SocketHandler.

◆ GetAddress()

const XrdNetAddr & XrdCl::AsyncSocketHandler::GetAddress ( ) const
inline

Get the address that the socket is connected to.

References pSockAddr.

◆ GetHostName()

std::string XrdCl::AsyncSocketHandler::GetHostName ( )

Get hostname.

◆ GetIpAddr()

std::string XrdCl::AsyncSocketHandler::GetIpAddr ( )

Get IP address.

◆ GetIpStack()

std::string XrdCl::AsyncSocketHandler::GetIpStack ( ) const

Get the IP stack.

◆ GetLastActivity()

time_t XrdCl::AsyncSocketHandler::GetLastActivity ( )
inline

Get timestamp of last registered socket activity.

References pLastActivity.

◆ GetStreamName()

const std::string & XrdCl::AsyncSocketHandler::GetStreamName ( )
inline

Get stream name.

References pStreamName.

◆ HandleHandShake()

void XrdCl::AsyncSocketHandler::HandleHandShake ( std::unique_ptr< Message msg)
protected

◆ HandleWaitRsp()

kXR_int32 XrdCl::AsyncSocketHandler::HandleWaitRsp ( Message rsp)
inlineprotected

◆ HandShakeNextStep()

void XrdCl::AsyncSocketHandler::HandShakeNextStep ( bool  done)
protected

◆ OnConnectionReturn()

virtual void XrdCl::AsyncSocketHandler::OnConnectionReturn ( )
protectedvirtual

◆ OnFault()

void XrdCl::AsyncSocketHandler::OnFault ( XRootDStatus  st)
protected

◆ OnFaultWhileHandshaking()

void XrdCl::AsyncSocketHandler::OnFaultWhileHandshaking ( XRootDStatus  st)
protected

◆ OnHeaderCorruption()

void XrdCl::AsyncSocketHandler::OnHeaderCorruption ( )
protected

◆ OnRead()

void XrdCl::AsyncSocketHandler::OnRead ( )
protected

◆ OnReadTimeout()

void XrdCl::AsyncSocketHandler::OnReadTimeout ( )
protected

◆ OnReadWhileHandshaking()

void XrdCl::AsyncSocketHandler::OnReadWhileHandshaking ( )
protected

◆ OnTimeoutWhileHandshaking()

void XrdCl::AsyncSocketHandler::OnTimeoutWhileHandshaking ( )
protected

◆ OnTLSHandShake()

void XrdCl::AsyncSocketHandler::OnTLSHandShake ( )
protected

◆ OnWrite()

void XrdCl::AsyncSocketHandler::OnWrite ( )
protected

◆ OnWriteTimeout()

void XrdCl::AsyncSocketHandler::OnWriteTimeout ( )
protected

◆ OnWriteWhileHandshaking()

void XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking ( )
protected

◆ SendHSMsg()

void XrdCl::AsyncSocketHandler::SendHSMsg ( )
protected

◆ SetAddress()

void XrdCl::AsyncSocketHandler::SetAddress ( const XrdNetAddr address)
inline

Set address.

References pSockAddr.

◆ ToStreamName()

static std::string XrdCl::AsyncSocketHandler::ToStreamName ( const URL url,
uint16_t  strmnb 
)
staticprotected

Convert Stream object and sub-stream number to stream name.

Member Data Documentation

◆ hsreader

std::unique_ptr<AsyncHSReader> XrdCl::AsyncSocketHandler::hsreader
protected

◆ hswriter

std::unique_ptr<AsyncHSWriter> XrdCl::AsyncSocketHandler::hswriter
protected

◆ pChannelData

AnyObject* XrdCl::AsyncSocketHandler::pChannelData
protected

◆ pConnectionStarted

time_t XrdCl::AsyncSocketHandler::pConnectionStarted
protected

◆ pConnectionTimeout

time_t XrdCl::AsyncSocketHandler::pConnectionTimeout
protected

◆ pHandShakeData

std::unique_ptr<HandShakeData> XrdCl::AsyncSocketHandler::pHandShakeData
protected

◆ pHandShakeDone

bool XrdCl::AsyncSocketHandler::pHandShakeDone
protected

◆ pHSWaitSeconds

time_t XrdCl::AsyncSocketHandler::pHSWaitSeconds
protected

◆ pHSWaitStarted

time_t XrdCl::AsyncSocketHandler::pHSWaitStarted
protected

◆ pLastActivity

time_t XrdCl::AsyncSocketHandler::pLastActivity
protected

Referenced by GetLastActivity().

◆ pPoller

Poller* XrdCl::AsyncSocketHandler::pPoller
protected

Referenced by DisableUplink(), and EnableUplink().

◆ pSockAddr

XrdNetAddr XrdCl::AsyncSocketHandler::pSockAddr
protected

Referenced by GetAddress(), and SetAddress().

◆ pSocket

Socket* XrdCl::AsyncSocketHandler::pSocket
protected

Referenced by DisableUplink(), and EnableUplink().

◆ pStream

Stream* XrdCl::AsyncSocketHandler::pStream
protected

◆ pStreamName

std::string XrdCl::AsyncSocketHandler::pStreamName
protected

Referenced by GetStreamName().

◆ pSubStreamNum

uint16_t XrdCl::AsyncSocketHandler::pSubStreamNum
protected

◆ pTimeoutResolution

uint16_t XrdCl::AsyncSocketHandler::pTimeoutResolution
protected

Referenced by EnableUplink().

◆ pTlsHandShakeOngoing

bool XrdCl::AsyncSocketHandler::pTlsHandShakeOngoing
protected

◆ pTransport

TransportHandler* XrdCl::AsyncSocketHandler::pTransport
protected

◆ pUrl

URL XrdCl::AsyncSocketHandler::pUrl
protected

◆ reqwriter

std::unique_ptr<AsyncMsgWriter> XrdCl::AsyncSocketHandler::reqwriter
protected

◆ rspreader

std::unique_ptr<AsyncMsgReader> XrdCl::AsyncSocketHandler::rspreader
protected

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