xrootd
|
#include <XrdClAsyncSocketHandler.hh>
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 XrdNetAddr & | GetAddress () 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 | |
Poller * | pPoller |
TransportHandler * | pTransport |
AnyObject * | pChannelData |
uint16_t | pSubStreamNum |
Stream * | pStream |
std::string | pStreamName |
Socket * | pSocket |
XrdNetAddr | pSockAddr |
std::unique_ptr< HandShakeData > | pHandShakeData |
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< AsyncHSWriter > | hswriter |
std::unique_ptr< AsyncMsgReader > | rspreader |
std::unique_ptr< AsyncHSReader > | hsreader |
std::unique_ptr< AsyncMsgWriter > | reqwriter |
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. | |
Utility class handling asynchronous socket interactions and forwarding events to the parent stream.
XrdCl::AsyncSocketHandler::AsyncSocketHandler | ( | const URL & | url, |
Poller * | poller, | ||
TransportHandler * | transport, | ||
AnyObject * | channelData, | ||
uint16_t | subStreamNum, | ||
Stream * | strm | ||
) |
Constructor.
XrdCl::AsyncSocketHandler::~AsyncSocketHandler | ( | ) |
Destructor.
|
protected |
XRootDStatus XrdCl::AsyncSocketHandler::Close | ( | ) |
Close the connection.
XRootDStatus XrdCl::AsyncSocketHandler::Connect | ( | time_t | timeout | ) |
Connect to the currently set address.
|
inline |
Disable uplink.
References XrdCl::Poller::EnableWriteNotification(), XrdCl::errPollerError, pPoller, pSocket, and XrdCl::stFatal.
|
protected |
|
inline |
Enable uplink.
References XrdCl::Poller::EnableWriteNotification(), XrdCl::errPollerError, pPoller, pSocket, pTimeoutResolution, and XrdCl::stFatal.
|
virtual |
Handle a socket event.
Implements XrdCl::SocketHandler.
|
inlineprotected |
|
inlineprotected |
|
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.
|
inline |
Get timestamp of last registered socket activity.
References pLastActivity.
|
inline |
Get stream name.
References pStreamName.
|
protected |
|
protected |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
Set address.
References pSockAddr.
|
staticprotected |
Convert Stream object and sub-stream number to stream name.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetLastActivity().
|
protected |
Referenced by DisableUplink(), and EnableUplink().
|
protected |
Referenced by GetAddress(), and SetAddress().
|
protected |
Referenced by DisableUplink(), and EnableUplink().
|
protected |
|
protected |
Referenced by GetStreamName().
|
protected |
|
protected |
Referenced by EnableUplink().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |