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.
 

Protected Member Functions

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

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()

bool 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.

◆ EventRead()

bool XrdCl::AsyncSocketHandler::EventRead ( uint8_t  type)
inlineprotected

◆ EventWrite()

bool XrdCl::AsyncSocketHandler::EventWrite ( uint8_t  type)
inlineprotected

◆ 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()

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

◆ HandleWaitRsp()

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

◆ HandShakeNextStep()

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

◆ OnConnectionReturn()

virtual bool 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()

bool XrdCl::AsyncSocketHandler::OnRead ( )
protected

◆ OnReadTimeout()

bool XrdCl::AsyncSocketHandler::OnReadTimeout ( )
protected

◆ OnReadWhileHandshaking()

bool XrdCl::AsyncSocketHandler::OnReadWhileHandshaking ( )
protected

◆ OnTimeoutWhileHandshaking()

bool XrdCl::AsyncSocketHandler::OnTimeoutWhileHandshaking ( )
protected

◆ OnTLSHandShake()

bool XrdCl::AsyncSocketHandler::OnTLSHandShake ( )
protected

◆ OnWrite()

bool XrdCl::AsyncSocketHandler::OnWrite ( )
protected

◆ OnWriteTimeout()

bool XrdCl::AsyncSocketHandler::OnWriteTimeout ( )
protected

◆ OnWriteWhileHandshaking()

bool XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking ( )
protected

◆ SendHSMsg()

bool 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: