xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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. More...
 
 ~AsyncSocketHandler ()
 Destructor. More...
 
void SetAddress (const XrdNetAddr &address)
 Set address. More...
 
const XrdNetAddrGetAddress () const
 Get the address that the socket is connected to. More...
 
XRootDStatus Connect (time_t timeout)
 Connect to the currently set address. More...
 
XRootDStatus Close ()
 Close the connection. More...
 
virtual void Event (uint8_t type, XrdCl::Socket *)
 Handle a socket event. More...
 
XRootDStatus EnableUplink ()
 Enable uplink. More...
 
XRootDStatus DisableUplink ()
 Disable uplink. More...
 
const std::string & GetStreamName ()
 Get stream name. More...
 
time_t GetLastActivity ()
 Get timestamp of last registered socket activity. More...
 
std::string GetIpStack () const
 Get the IP stack. More...
 
std::string GetIpAddr ()
 Get IP address. More...
 
std::string GetHostName ()
 Get hostname. More...
 
- Public Member Functions inherited from XrdCl::SocketHandler
virtual ~SocketHandler ()
 
virtual void Initialize (Poller *)
 Initializer. More...
 
virtual void Finalize ()
 Finalizer. More...
 

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

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

Detailed Description

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

Constructor & Destructor Documentation

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

Constructor.

XrdCl::AsyncSocketHandler::~AsyncSocketHandler ( )

Destructor.

Member Function Documentation

bool XrdCl::AsyncSocketHandler::CheckHSWait ( )
protected
XRootDStatus XrdCl::AsyncSocketHandler::Close ( )

Close the connection.

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

Connect to the currently set address.

XRootDStatus XrdCl::AsyncSocketHandler::DisableUplink ( )
inline
XRootDStatus XrdCl::AsyncSocketHandler::DoTlsHandShake ( )
protected
XRootDStatus XrdCl::AsyncSocketHandler::EnableUplink ( )
inline
virtual void XrdCl::AsyncSocketHandler::Event ( uint8_t  type,
XrdCl::Socket  
)
virtual

Handle a socket event.

Implements XrdCl::SocketHandler.

bool XrdCl::AsyncSocketHandler::EventRead ( uint8_t  type)
inlineprotected
bool XrdCl::AsyncSocketHandler::EventWrite ( uint8_t  type)
inlineprotected
const XrdNetAddr& XrdCl::AsyncSocketHandler::GetAddress ( ) const
inline

Get the address that the socket is connected to.

References pSockAddr.

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

Get hostname.

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

Get IP address.

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

Get the IP stack.

time_t XrdCl::AsyncSocketHandler::GetLastActivity ( )
inline

Get timestamp of last registered socket activity.

References pLastActivity.

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

Get stream name.

References pStreamName.

bool XrdCl::AsyncSocketHandler::HandleHandShake ( std::unique_ptr< Message msg)
protected
kXR_int32 XrdCl::AsyncSocketHandler::HandleWaitRsp ( Message rsp)
inlineprotected
bool XrdCl::AsyncSocketHandler::HandShakeNextStep ( bool  done)
protected
virtual bool XrdCl::AsyncSocketHandler::OnConnectionReturn ( )
protectedvirtual
void XrdCl::AsyncSocketHandler::OnFault ( XRootDStatus  st)
protected
void XrdCl::AsyncSocketHandler::OnFaultWhileHandshaking ( XRootDStatus  st)
protected
void XrdCl::AsyncSocketHandler::OnHeaderCorruption ( )
protected
bool XrdCl::AsyncSocketHandler::OnRead ( )
protected
bool XrdCl::AsyncSocketHandler::OnReadTimeout ( )
protected
bool XrdCl::AsyncSocketHandler::OnReadWhileHandshaking ( )
protected
bool XrdCl::AsyncSocketHandler::OnTimeoutWhileHandshaking ( )
protected
bool XrdCl::AsyncSocketHandler::OnTLSHandShake ( )
protected
bool XrdCl::AsyncSocketHandler::OnWrite ( )
protected
bool XrdCl::AsyncSocketHandler::OnWriteTimeout ( )
protected
bool XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking ( )
protected
bool XrdCl::AsyncSocketHandler::SendHSMsg ( )
protected
void XrdCl::AsyncSocketHandler::SetAddress ( const XrdNetAddr address)
inline

Set address.

References pSockAddr.

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

std::unique_ptr<AsyncHSReader> XrdCl::AsyncSocketHandler::hsreader
protected
std::unique_ptr<AsyncHSWriter> XrdCl::AsyncSocketHandler::hswriter
protected
AnyObject* XrdCl::AsyncSocketHandler::pChannelData
protected
time_t XrdCl::AsyncSocketHandler::pConnectionStarted
protected
time_t XrdCl::AsyncSocketHandler::pConnectionTimeout
protected
std::unique_ptr<HandShakeData> XrdCl::AsyncSocketHandler::pHandShakeData
protected
bool XrdCl::AsyncSocketHandler::pHandShakeDone
protected
time_t XrdCl::AsyncSocketHandler::pHSWaitSeconds
protected
time_t XrdCl::AsyncSocketHandler::pHSWaitStarted
protected
time_t XrdCl::AsyncSocketHandler::pLastActivity
protected

Referenced by GetLastActivity().

Poller* XrdCl::AsyncSocketHandler::pPoller
protected

Referenced by DisableUplink(), and EnableUplink().

XrdNetAddr XrdCl::AsyncSocketHandler::pSockAddr
protected

Referenced by GetAddress(), and SetAddress().

Socket* XrdCl::AsyncSocketHandler::pSocket
protected

Referenced by DisableUplink(), and EnableUplink().

Stream* XrdCl::AsyncSocketHandler::pStream
protected
std::string XrdCl::AsyncSocketHandler::pStreamName
protected

Referenced by GetStreamName().

uint16_t XrdCl::AsyncSocketHandler::pSubStreamNum
protected
uint16_t XrdCl::AsyncSocketHandler::pTimeoutResolution
protected

Referenced by EnableUplink().

bool XrdCl::AsyncSocketHandler::pTlsHandShakeOngoing
protected
TransportHandler* XrdCl::AsyncSocketHandler::pTransport
protected
URL XrdCl::AsyncSocketHandler::pUrl
protected
std::unique_ptr<AsyncMsgWriter> XrdCl::AsyncSocketHandler::reqwriter
protected
std::unique_ptr<AsyncMsgReader> XrdCl::AsyncSocketHandler::rspreader
protected

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