XRootD
Loading...
Searching...
No Matches
XrdCl::AsyncSocketHandler Class Reference

#include <XrdClAsyncSocketHandler.hh>

Inheritance diagram for XrdCl::AsyncSocketHandler:
Collaboration diagram for XrdCl::AsyncSocketHandler:

Public Member Functions

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

Protected Member Functions

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

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

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.

Definition at line 43 of file XrdClAsyncSocketHandler.hh.

Constructor & Destructor Documentation

◆ AsyncSocketHandler()

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

Constructor.

Definition at line 35 of file XrdClAsyncSocketHandler.cc.

40 :
41 pPoller( poller ),
42 pTransport( transport ),
43 pChannelData( channelData ),
44 pSubStreamNum( subStreamNum ),
45 pStream( strm ),
46 pStreamName( ToStreamName( url, subStreamNum ) ),
47 pSocket( new Socket() ),
48 pHandShakeDone( false ),
51 pHSWaitStarted( 0 ),
52 pHSWaitSeconds( 0 ),
53 pUrl( url ),
55 {
56 Env *env = DefaultEnv::GetEnv();
57
58 int timeoutResolution = DefaultTimeoutResolution;
59 env->GetInt( "TimeoutResolution", timeoutResolution );
60 pTimeoutResolution = timeoutResolution;
61
62 pSocket->SetChannelID( pChannelData );
63 pLastActivity = time(0);
64 }
static std::string ToStreamName(const URL &url, uint16_t strmnb)
Convert Stream object and sub-stream number to stream name.
static Env * GetEnv()
Get default client environment.
const int DefaultTimeoutResolution

References XrdCl::DefaultTimeoutResolution, XrdCl::DefaultEnv::GetEnv(), XrdCl::Env::GetInt(), pChannelData, pConnectionStarted, pConnectionTimeout, pHandShakeDone, pHSWaitSeconds, pHSWaitStarted, pLastActivity, pPoller, pSocket, pStream, pStreamName, pSubStreamNum, pTimeoutResolution, pTlsHandShakeOngoing, pTransport, pUrl, and ToStreamName().

Here is the call graph for this function:

◆ ~AsyncSocketHandler()

XrdCl::AsyncSocketHandler::~AsyncSocketHandler ( )

Destructor.

Definition at line 69 of file XrdClAsyncSocketHandler.cc.

70 {
71 Close();
72 delete pSocket;
73 }
XRootDStatus Close()
Close the connection.

References Close(), and pSocket.

Here is the call graph for this function:

Member Function Documentation

◆ CheckHSWait()

bool XrdCl::AsyncSocketHandler::CheckHSWait ( )
protected

Definition at line 887 of file XrdClAsyncSocketHandler.cc.

888 {
889 time_t now = time( 0 );
890 if( now - pHSWaitStarted >= pHSWaitSeconds )
891 {
892 Log *log = DefaultEnv::GetLog();
893 log->Debug( AsyncSockMsg, "[%s] The hand-shake wait time elapsed, will "
894 "replay the endsess request.", pStreamName.c_str() );
895 if( !SendHSMsg() )
896 return false;
897 //------------------------------------------------------------------------
898 // Make sure the wait state is reset
899 //------------------------------------------------------------------------
900 pHSWaitSeconds = 0;
901 pHSWaitStarted = 0;
902 }
903 return true;
904 }
bool SendHSMsg() XRD_WARN_UNUSED_RESULT
static Log * GetLog()
Get default log.
const uint64_t AsyncSockMsg
XrdSysError Log
Definition XrdConfig.cc:113

References XrdCl::AsyncSockMsg, XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), pHSWaitSeconds, pHSWaitStarted, pStreamName, and SendHSMsg().

Referenced by EventRead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Close()

XRootDStatus XrdCl::AsyncSocketHandler::Close ( )

Close the connection.

Definition at line 187 of file XrdClAsyncSocketHandler.cc.

188 {
189 Log *log = DefaultEnv::GetLog();
190 log->Debug( AsyncSockMsg, "[%s] Closing the socket", pStreamName.c_str() );
191
192 pTransport->Disconnect( *pChannelData,
194
195 pPoller->RemoveSocket( pSocket );
196 pSocket->Close();
197 return XRootDStatus();
198 }

References XrdCl::AsyncSockMsg, XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), pChannelData, pPoller, pSocket, pStreamName, pSubStreamNum, and pTransport.

Referenced by ~AsyncSocketHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Connect()

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

Connect to the currently set address.

Definition at line 78 of file XrdClAsyncSocketHandler.cc.

79 {
80 Log *log = DefaultEnv::GetLog();
82 pConnectionTimeout = timeout;
83
84 //--------------------------------------------------------------------------
85 // Initialize the socket
86 //--------------------------------------------------------------------------
87 XRootDStatus st = pSocket->Initialize( pSockAddr.Family() );
88 if( !st.IsOK() )
89 {
90 log->Error( AsyncSockMsg, "[%s] Unable to initialize socket: %s",
91 pStreamName.c_str(), st.ToString().c_str() );
92 st.status = stFatal;
93 return st;
94 }
95
96 //--------------------------------------------------------------------------
97 // Set the keep-alive up
98 //--------------------------------------------------------------------------
99 Env *env = DefaultEnv::GetEnv();
100
101 int keepAlive = DefaultTCPKeepAlive;
102 env->GetInt( "TCPKeepAlive", keepAlive );
103 if( keepAlive )
104 {
105 int param = 1;
106 XRootDStatus st = pSocket->SetSockOpt( SOL_SOCKET, SO_KEEPALIVE, &param,
107 sizeof(param) );
108 if( !st.IsOK() )
109 log->Error( AsyncSockMsg, "[%s] Unable to turn on keepalive: %s",
110 pStreamName.c_str(), st.ToString().c_str() );
111
112#if ( defined(__linux__) || defined(__GNU__) ) && defined( TCP_KEEPIDLE ) && \
113 defined( TCP_KEEPINTVL ) && defined( TCP_KEEPCNT )
114
116 env->GetInt( "TCPKeepAliveTime", param );
117 st = pSocket->SetSockOpt(SOL_TCP, TCP_KEEPIDLE, &param, sizeof(param));
118 if( !st.IsOK() )
119 log->Error( AsyncSockMsg, "[%s] Unable to set keepalive time: %s",
120 pStreamName.c_str(), st.ToString().c_str() );
121
123 env->GetInt( "TCPKeepAliveInterval", param );
124 st = pSocket->SetSockOpt(SOL_TCP, TCP_KEEPINTVL, &param, sizeof(param));
125 if( !st.IsOK() )
126 log->Error( AsyncSockMsg, "[%s] Unable to set keepalive interval: %s",
127 pStreamName.c_str(), st.ToString().c_str() );
128
130 env->GetInt( "TCPKeepAliveProbes", param );
131 st = pSocket->SetSockOpt(SOL_TCP, TCP_KEEPCNT, &param, sizeof(param));
132 if( !st.IsOK() )
133 log->Error( AsyncSockMsg, "[%s] Unable to set keepalive probes: %s",
134 pStreamName.c_str(), st.ToString().c_str() );
135#endif
136 }
137
138 pHandShakeDone = false;
139 pTlsHandShakeOngoing = false;
140 pHSWaitStarted = 0;
141 pHSWaitSeconds = 0;
142 pReqConnResetError = XRootDStatus();
143
144 //--------------------------------------------------------------------------
145 // Initiate async connection to the address
146 //--------------------------------------------------------------------------
147 char nameBuff[256];
148 pSockAddr.Format( nameBuff, sizeof(nameBuff), XrdNetAddrInfo::fmtAdv6 );
149 log->Debug( AsyncSockMsg, "[%s] Attempting connection to %s",
150 pStreamName.c_str(), nameBuff );
151
152 st = pSocket->ConnectToAddress( pSockAddr, 0 );
153 if( !st.IsOK() )
154 {
155 log->Error( AsyncSockMsg, "[%s] Unable to initiate the connection: %s",
156 pStreamName.c_str(), st.ToString().c_str() );
157 return st;
158 }
159
160 pSocket->SetStatus( Socket::Connecting );
161
162 //--------------------------------------------------------------------------
163 // We should get the ready to write event once we're really connected
164 // so we need to listen to it
165 //--------------------------------------------------------------------------
166 if( !pPoller->AddSocket( pSocket, this ) )
167 {
168 XRootDStatus st( stFatal, errPollerError );
169 pSocket->Close();
170 return st;
171 }
172
173 if( !pPoller->EnableWriteNotification( pSocket, true, pTimeoutResolution ) )
174 {
175 XRootDStatus st( stFatal, errPollerError );
176 pPoller->RemoveSocket( pSocket );
177 pSocket->Close();
178 return st;
179 }
180
181 return XRootDStatus();
182 }
@ Connecting
The connection process is in progress.
const int DefaultTCPKeepAliveProbes
const uint16_t stFatal
Fatal error, it's still an error.
const uint16_t errPollerError
const int DefaultTCPKeepAliveInterval
const int DefaultTCPKeepAlive
const int DefaultTCPKeepAliveTime

References XrdCl::AsyncSockMsg, XrdCl::Socket::Connecting, XrdCl::Log::Debug(), XrdCl::DefaultTCPKeepAlive, XrdCl::DefaultTCPKeepAliveInterval, XrdCl::DefaultTCPKeepAliveProbes, XrdCl::DefaultTCPKeepAliveTime, XrdCl::Log::Error(), XrdCl::errPollerError, XrdNetAddrInfo::fmtAdv6, XrdCl::DefaultEnv::GetEnv(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetLog(), XrdCl::Status::IsOK(), pConnectionStarted, pConnectionTimeout, pHandShakeDone, pHSWaitSeconds, pHSWaitStarted, pLastActivity, pPoller, pReqConnResetError, pSockAddr, pSocket, pStreamName, pTimeoutResolution, pTlsHandShakeOngoing, XrdCl::Status::status, XrdCl::stFatal, and XrdCl::Status::ToString().

Here is the call graph for this function:

◆ DisableUplink()

XRootDStatus XrdCl::AsyncSocketHandler::DisableUplink ( )
inline

Disable uplink.

Definition at line 105 of file XrdClAsyncSocketHandler.hh.

106 {
107 if( !pPoller->EnableWriteNotification( pSocket, false ) )
108 return XRootDStatus( stFatal, errPollerError );
109 return XRootDStatus();
110 }

References XrdCl::errPollerError, pPoller, pSocket, and XrdCl::stFatal.

Referenced by OnWrite(), and OnWriteWhileHandshaking().

Here is the caller graph for this function:

◆ DoTlsHandShake()

XRootDStatus XrdCl::AsyncSocketHandler::DoTlsHandShake ( )
protected

Definition at line 797 of file XrdClAsyncSocketHandler.cc.

798 {
799 Log *log = DefaultEnv::GetLog();
800 log->Debug( AsyncSockMsg, "[%s] TLS hand-shake exchange.", pStreamName.c_str() );
801
802 XRootDStatus st;
803 if( !( st = pSocket->TlsHandShake( this, pUrl.GetHostName() ) ).IsOK() )
804 {
805 pTlsHandShakeOngoing = false;
807 return st;
808 }
809
810 if( st.code == suRetry )
811 {
813 return st;
814 }
815
816 pTlsHandShakeOngoing = false;
817 log->Info( AsyncSockMsg, "[%s] TLS hand-shake done.", pStreamName.c_str() );
818
819 return st;
820 }
void OnFaultWhileHandshaking(XRootDStatus st)
const uint16_t suRetry

References XrdCl::AsyncSockMsg, XrdCl::Status::code, XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::Log::Info(), OnFaultWhileHandshaking(), pSocket, pStreamName, pTlsHandShakeOngoing, pUrl, and XrdCl::suRetry.

Referenced by HandleHandShake(), and OnTLSHandShake().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnableUplink()

XRootDStatus XrdCl::AsyncSocketHandler::EnableUplink ( )
inline

Enable uplink.

Definition at line 95 of file XrdClAsyncSocketHandler.hh.

96 {
97 if( !pPoller->EnableWriteNotification( pSocket, true, pTimeoutResolution ) )
98 return XRootDStatus( stFatal, errPollerError );
99 return XRootDStatus();
100 }

References XrdCl::errPollerError, pPoller, pSocket, pTimeoutResolution, and XrdCl::stFatal.

Referenced by HandShakeNextStep(), and SendHSMsg().

Here is the caller graph for this function:

◆ Event()

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

Handle a socket event.

Implements XrdCl::SocketHandler.

Definition at line 211 of file XrdClAsyncSocketHandler.cc.

212 {
213 //--------------------------------------------------------------------------
214 // First check if the socket itself wants to apply some mapping on the
215 // event. E.g. in case of TLS socket it might want to map read events to
216 // write events and vice-versa.
217 //--------------------------------------------------------------------------
218 type = pSocket->MapEvent( type );
219
220 //--------------------------------------------------------------------------
221 // Handle any read or write events. If any of the handlers indicate an error
222 // we will have been disconnected. A disconnection may cause the current
223 // object to be asynchronously reused or deleted, so we return immediately.
224 //--------------------------------------------------------------------------
225 if( !EventRead( type ) )
226 return;
227
228 //--------------------------------------------------------------------------
229 // If there's a previosuly noted ECONNRESET error from write we give the
230 // fault now. This gave us the chance to process a read event.
231 //--------------------------------------------------------------------------
232 if( !pReqConnResetError.IsOK() )
233 {
235 return;
236 }
237
238 if( !EventWrite( type ) )
239 return;
240 }
bool EventRead(uint8_t type) XRD_WARN_UNUSED_RESULT
bool EventWrite(uint8_t type) XRD_WARN_UNUSED_RESULT

References EventRead(), EventWrite(), OnFault(), pReqConnResetError, and pSocket.

Here is the call graph for this function:

◆ EventRead()

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

Definition at line 245 of file XrdClAsyncSocketHandler.cc.

246 {
247 //--------------------------------------------------------------------------
248 // Read event
249 //--------------------------------------------------------------------------
250 if( type & ReadyToRead )
251 {
252 pLastActivity = time(0);
254 return OnTLSHandShake();
255
256 if( likely( pHandShakeDone ) )
257 return OnRead();
258
259 return OnReadWhileHandshaking();
260 }
261
262 //--------------------------------------------------------------------------
263 // Read timeout
264 //--------------------------------------------------------------------------
265 else if( type & ReadTimeOut )
266 {
267 if( pHSWaitSeconds )
268 {
269 if( !CheckHSWait() )
270 return false;
271 }
272
273 if( likely( pHandShakeDone ) )
274 return OnReadTimeout();
275
277 }
278
279 return true;
280 }
#define likely(x)
#define unlikely(x)
bool OnReadTimeout() XRD_WARN_UNUSED_RESULT
bool OnTimeoutWhileHandshaking() XRD_WARN_UNUSED_RESULT
bool CheckHSWait() XRD_WARN_UNUSED_RESULT
bool OnReadWhileHandshaking() XRD_WARN_UNUSED_RESULT
bool OnRead() XRD_WARN_UNUSED_RESULT
bool OnTLSHandShake() XRD_WARN_UNUSED_RESULT
@ ReadTimeOut
Read timeout.
@ ReadyToRead
New data has arrived.

References CheckHSWait(), likely, OnRead(), OnReadTimeout(), OnReadWhileHandshaking(), OnTimeoutWhileHandshaking(), OnTLSHandShake(), pHandShakeDone, pHSWaitSeconds, pLastActivity, pTlsHandShakeOngoing, XrdCl::SocketHandler::ReadTimeOut, XrdCl::SocketHandler::ReadyToRead, and unlikely.

Referenced by Event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EventWrite()

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

Definition at line 285 of file XrdClAsyncSocketHandler.cc.

286 {
287 //--------------------------------------------------------------------------
288 // Write event
289 //--------------------------------------------------------------------------
290 if( type & ReadyToWrite )
291 {
292 pLastActivity = time(0);
293 if( unlikely( pSocket->GetStatus() == Socket::Connecting ) )
294 return OnConnectionReturn();
295
296 //------------------------------------------------------------------------
297 // Make sure we are not writing anything if we have been told to wait.
298 //------------------------------------------------------------------------
299 if( pHSWaitSeconds != 0 )
300 return true;
301
303 return OnTLSHandShake();
304
305 if( likely( pHandShakeDone ) )
306 return OnWrite();
307
309 }
310
311 //--------------------------------------------------------------------------
312 // Write timeout
313 //--------------------------------------------------------------------------
314 else if( type & WriteTimeOut )
315 {
316 if( likely( pHandShakeDone ) )
317 return OnWriteTimeout();
318
320 }
321
322 return true;
323 }
virtual bool OnConnectionReturn() XRD_WARN_UNUSED_RESULT
bool OnWriteTimeout() XRD_WARN_UNUSED_RESULT
bool OnWrite() XRD_WARN_UNUSED_RESULT
bool OnWriteWhileHandshaking() XRD_WARN_UNUSED_RESULT
@ ReadyToWrite
Writing won't block.
@ WriteTimeOut
Write timeout.

References XrdCl::Socket::Connecting, likely, OnConnectionReturn(), OnTimeoutWhileHandshaking(), OnTLSHandShake(), OnWrite(), OnWriteTimeout(), OnWriteWhileHandshaking(), pHandShakeDone, pHSWaitSeconds, pLastActivity, pSocket, pTlsHandShakeOngoing, XrdCl::SocketHandler::ReadyToWrite, unlikely, and XrdCl::SocketHandler::WriteTimeOut.

Referenced by Event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAddress()

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

Get the address that the socket is connected to.

Definition at line 72 of file XrdClAsyncSocketHandler.hh.

73 {
74 return pSockAddr;
75 }

References pSockAddr.

◆ GetHostName()

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

Get hostname.

Definition at line 929 of file XrdClAsyncSocketHandler.cc.

930 {
931 const char *cstr = pSockAddr.Name();
932 if( !cstr )
933 return std::string();
934 return cstr;
935 }

References pSockAddr.

◆ GetIpAddr()

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

Get IP address.

Definition at line 919 of file XrdClAsyncSocketHandler.cc.

920 {
921 char nameBuff[256];
922 pSockAddr.Format( nameBuff, sizeof(nameBuff), XrdNetAddrInfo::fmtAddr, XrdNetAddrInfo::noPort );
923 return nameBuff;
924 }
static const int noPort
Do not add port number.
@ fmtAddr
Address using suitable ipv4 or ipv6 format.

References XrdNetAddrInfo::fmtAddr, XrdNetAddrInfo::noPort, and pSockAddr.

◆ GetIpStack()

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

Get the IP stack.

Definition at line 909 of file XrdClAsyncSocketHandler.cc.

910 {
911 std::string ipstack( ( pSockAddr.isIPType( XrdNetAddr::IPType::IPv6 ) &&
912 !pSockAddr.isMapped() ) ? "IPv6" : "IPv4" );
913 return ipstack;
914 }

References XrdNetAddrInfo::IPv6, and pSockAddr.

◆ GetLastActivity()

time_t XrdCl::AsyncSocketHandler::GetLastActivity ( )
inline

Get timestamp of last registered socket activity.

Definition at line 123 of file XrdClAsyncSocketHandler.hh.

124 {
125 return pLastActivity;
126 }

References pLastActivity.

◆ GetStreamName()

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

Get stream name.

Definition at line 115 of file XrdClAsyncSocketHandler.hh.

116 {
117 return pStreamName;
118 }

References pStreamName.

◆ HandleHandShake()

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

Definition at line 602 of file XrdClAsyncSocketHandler.cc.

603 {
604 //--------------------------------------------------------------------------
605 // OK, we have a new message, let's deal with it;
606 //--------------------------------------------------------------------------
607 pHandShakeData->in = msg.release();
608 XRootDStatus st = pTransport->HandShake( pHandShakeData.get(), *pChannelData );
609
610 //--------------------------------------------------------------------------
611 // Deal with wait responses
612 //--------------------------------------------------------------------------
613 kXR_int32 waitSeconds = HandleWaitRsp( pHandShakeData->in );
614
615 delete pHandShakeData->in;
616 pHandShakeData->in = 0;
617
618 if( !st.IsOK() )
619 {
621 return false;
622 }
623
624 if( st.code == suRetry )
625 {
626 //------------------------------------------------------------------------
627 // We are handling a wait response and the transport handler told
628 // as to retry the request
629 //------------------------------------------------------------------------
630 if( waitSeconds >=0 )
631 {
632 time_t resendTime = ::time( 0 ) + waitSeconds;
633 if( resendTime > pConnectionStarted + pConnectionTimeout )
634 {
635 Log *log = DefaultEnv::GetLog();
636 log->Error( AsyncSockMsg,
637 "[%s] Won't retry kXR_endsess request because would"
638 "reach connection timeout.",
639 pStreamName.c_str() );
640
642 return false;
643 }
644 else
645 {
646 //--------------------------------------------------------------------
647 // We need to wait before replaying the request
648 //--------------------------------------------------------------------
649 Log *log = DefaultEnv::GetLog();
650 log->Debug( AsyncSockMsg, "[%s] Received a wait response to endsess request, "
651 "will wait for %d seconds before replaying the endsess request",
652 pStreamName.c_str(), waitSeconds );
653 pHSWaitStarted = time( 0 );
654 pHSWaitSeconds = waitSeconds;
655 }
656 return true;
657 }
658 //------------------------------------------------------------------------
659 // We are re-sending a protocol request
660 //------------------------------------------------------------------------
661 else if( pHandShakeData->out )
662 {
663 return SendHSMsg();
664 }
665 }
666
667 //--------------------------------------------------------------------------
668 // If now is the time to enable encryption
669 //--------------------------------------------------------------------------
670 if( !pSocket->IsEncrypted() &&
671 pTransport->NeedEncryption( pHandShakeData.get(), *pChannelData ) )
672 {
673 XRootDStatus st = DoTlsHandShake();
674 if( !st.IsOK() )
675 return false;
676 if ( st.code == suRetry )
677 return true;
678 }
679
680 //--------------------------------------------------------------------------
681 // Now prepare the next step of the hand-shake procedure
682 //--------------------------------------------------------------------------
683 return HandShakeNextStep( st.IsOK() && st.code == suDone );
684 }
int kXR_int32
Definition XPtypes.hh:89
kXR_int32 HandleWaitRsp(Message *rsp)
bool HandShakeNextStep(bool done) XRD_WARN_UNUSED_RESULT
std::unique_ptr< HandShakeData > pHandShakeData
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t errSocketTimeout
const uint16_t suDone

References XrdCl::AsyncSockMsg, XrdCl::Status::code, XrdCl::Log::Debug(), DoTlsHandShake(), XrdCl::Log::Error(), XrdCl::errSocketTimeout, XrdCl::DefaultEnv::GetLog(), HandleWaitRsp(), HandShakeNextStep(), XrdCl::Status::IsOK(), OnFaultWhileHandshaking(), pChannelData, pConnectionStarted, pConnectionTimeout, pHandShakeData, pHSWaitSeconds, pHSWaitStarted, pSocket, pStreamName, pTransport, SendHSMsg(), XrdCl::stError, XrdCl::suDone, and XrdCl::suRetry.

Referenced by OnReadWhileHandshaking().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandleWaitRsp()

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

Definition at line 873 of file XrdClAsyncSocketHandler.cc.

874 {
875 // It would be more coherent if this could be done in the
876 // transport layer, unfortunately the API does not allow it.
877 kXR_int32 waitSeconds = -1;
878 ServerResponse *rsp = (ServerResponse*)msg->GetBuffer();
879 if( rsp->hdr.status == kXR_wait )
880 waitSeconds = rsp->body.wait.seconds;
881 return waitSeconds;
882 }
union ServerResponse::@040373375333017131300127053271011057331004327334 body
@ kXR_wait
Definition XProtocol.hh:905
ServerResponseHeader hdr

References ServerResponse::body, XrdCl::Buffer::GetBuffer(), ServerResponse::hdr, kXR_wait, and ServerResponseHeader::status.

Referenced by HandleHandShake().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HandShakeNextStep()

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

Definition at line 689 of file XrdClAsyncSocketHandler.cc.

690 {
691 //--------------------------------------------------------------------------
692 // We successfully proceeded to the next step
693 //--------------------------------------------------------------------------
694 ++pHandShakeData->step;
695
696 //--------------------------------------------------------------------------
697 // The hand shake process is done
698 //--------------------------------------------------------------------------
699 if( done )
700 {
701 pHandShakeData.reset();
702 hswriter.reset();
703 hsreader.reset();
704 //------------------------------------------------------------------------
705 // Initialize the request writer & reader
706 //------------------------------------------------------------------------
707 reqwriter.reset( new AsyncMsgWriter( *pTransport, *pSocket, pStreamName, *pStream, pSubStreamNum, *pChannelData ) );
708 rspreader.reset( new AsyncMsgReader( *pTransport, *pSocket, pStreamName, *pStream, pSubStreamNum ) );
709 XRootDStatus st;
710 if( !(st = EnableUplink()).IsOK() )
711 {
713 return false;
714 }
715 pHandShakeDone = true;
716 pStream->OnConnect( pSubStreamNum );
717 }
718 //--------------------------------------------------------------------------
719 // The transport handler gave us something to write
720 //--------------------------------------------------------------------------
721 else if( pHandShakeData->out )
722 {
723 return SendHSMsg();
724 }
725 return true;
726 }
std::unique_ptr< AsyncHSWriter > hswriter
std::unique_ptr< AsyncHSReader > hsreader
std::unique_ptr< AsyncMsgWriter > reqwriter
XRootDStatus EnableUplink()
Enable uplink.
std::unique_ptr< AsyncMsgReader > rspreader

References EnableUplink(), hsreader, hswriter, OnFaultWhileHandshaking(), pChannelData, pHandShakeData, pHandShakeDone, pSocket, pStream, pStreamName, pSubStreamNum, pTransport, reqwriter, rspreader, and SendHSMsg().

Referenced by HandleHandShake(), and OnTLSHandShake().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnConnectionReturn()

bool XrdCl::AsyncSocketHandler::OnConnectionReturn ( )
protectedvirtual

Definition at line 328 of file XrdClAsyncSocketHandler.cc.

329 {
330 //--------------------------------------------------------------------------
331 // Check whether we were able to connect
332 //--------------------------------------------------------------------------
333 Log *log = DefaultEnv::GetLog();
334 log->Debug( AsyncSockMsg, "[%s] Async connection call returned",
335 pStreamName.c_str() );
336
337 int errorCode = 0;
338 socklen_t optSize = sizeof( errorCode );
339 XRootDStatus st = pSocket->GetSockOpt( SOL_SOCKET, SO_ERROR, &errorCode,
340 &optSize );
341
342 //--------------------------------------------------------------------------
343 // This is an internal error really (either logic or system fault),
344 // so we call it a day and don't retry
345 //--------------------------------------------------------------------------
346 if( !st.IsOK() )
347 {
348 log->Error( AsyncSockMsg, "[%s] Unable to get the status of the "
349 "connect operation: %s", pStreamName.c_str(),
350 XrdSysE2T( errno ) );
351 pStream->OnConnectError( pSubStreamNum,
352 XRootDStatus( stFatal, errSocketOptError, errno ) );
353 return false;
354 }
355
356 //--------------------------------------------------------------------------
357 // We were unable to connect
358 //--------------------------------------------------------------------------
359 if( errorCode )
360 {
361 log->Error( AsyncSockMsg, "[%s] Unable to connect: %s",
362 pStreamName.c_str(), XrdSysE2T( errorCode ) );
363 pStream->OnConnectError( pSubStreamNum,
364 XRootDStatus( stError, errConnectionError ) );
365 return false;
366 }
367 pSocket->SetStatus( Socket::Connected );
368
369 //--------------------------------------------------------------------------
370 // Cork the socket
371 //--------------------------------------------------------------------------
372 st = pSocket->Cork();
373 if( !st.IsOK() )
374 {
375 pStream->OnConnectError( pSubStreamNum, st );
376 return false;
377 }
378
379 //--------------------------------------------------------------------------
380 // Initialize the handshake
381 //--------------------------------------------------------------------------
382 pHandShakeData.reset( new HandShakeData( pStream->GetURL(),
383 pSubStreamNum ) );
384 pHandShakeData->serverAddr = pSocket->GetServerAddress();
385 pHandShakeData->clientName = pSocket->GetSockName();
386 pHandShakeData->streamName = pStreamName;
387
388 st = pTransport->HandShake( pHandShakeData.get(), *pChannelData );
389 if( !st.IsOK() )
390 {
391 log->Error( AsyncSockMsg, "[%s] Connection negotiation failed",
392 pStreamName.c_str() );
393 pStream->OnConnectError( pSubStreamNum, st );
394 return false;
395 }
396
397 if( st.code != suRetry )
398 ++pHandShakeData->step;
399
400 //--------------------------------------------------------------------------
401 // Initialize the hand-shake reader and writer
402 //--------------------------------------------------------------------------
403 hswriter.reset( new AsyncHSWriter( *pSocket, pStreamName ) );
404 hsreader.reset( new AsyncHSReader( *pTransport, *pSocket, pStreamName, *pStream, pSubStreamNum ) );
405
406 //--------------------------------------------------------------------------
407 // Transport has given us something to send
408 //--------------------------------------------------------------------------
409 if( pHandShakeData->out )
410 {
411 hswriter->Reset( pHandShakeData->out );
412 pHandShakeData->out = nullptr;
413 }
414
415 //--------------------------------------------------------------------------
416 // Listen to what the server has to say
417 //--------------------------------------------------------------------------
418 if( !pPoller->EnableReadNotification( pSocket, true, pTimeoutResolution ) )
419 {
420 pStream->OnConnectError( pSubStreamNum,
421 XRootDStatus( stFatal, errPollerError ) );
422 return false;
423 }
424 return true;
425 }
const char * XrdSysE2T(int errcode)
Definition XrdSysE2T.cc:104
@ Connected
The socket is connected.
const uint16_t errSocketOptError
const uint16_t errConnectionError

References XrdCl::AsyncSockMsg, XrdCl::Status::code, XrdCl::Socket::Connected, XrdCl::Log::Debug(), XrdCl::errConnectionError, XrdCl::Log::Error(), XrdCl::errPollerError, XrdCl::errSocketOptError, XrdCl::DefaultEnv::GetLog(), hsreader, hswriter, XrdCl::Status::IsOK(), pChannelData, pHandShakeData, pPoller, pSocket, pStream, pStreamName, pSubStreamNum, pTimeoutResolution, pTransport, XrdCl::stError, XrdCl::stFatal, XrdCl::suRetry, and XrdSysE2T().

Referenced by EventWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFault()

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

Definition at line 731 of file XrdClAsyncSocketHandler.cc.

732 {
733 Log *log = DefaultEnv::GetLog();
734 log->Error( AsyncSockMsg, "[%s] Socket error encountered: %s",
735 pStreamName.c_str(), st.ToString().c_str() );
736
737 pStream->OnError( pSubStreamNum, st );
738 }

References XrdCl::AsyncSockMsg, XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), pStream, pStreamName, pSubStreamNum, and XrdCl::Status::ToString().

Referenced by Event(), OnRead(), OnReadWhileHandshaking(), and OnWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFaultWhileHandshaking()

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

Definition at line 743 of file XrdClAsyncSocketHandler.cc.

744 {
745 Log *log = DefaultEnv::GetLog();
746 log->Error( AsyncSockMsg, "[%s] Socket error while handshaking: %s",
747 pStreamName.c_str(), st.ToString().c_str() );
748
749 pStream->OnConnectError( pSubStreamNum, st );
750 }

References XrdCl::AsyncSockMsg, XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), pStream, pStreamName, pSubStreamNum, and XrdCl::Status::ToString().

Referenced by DoTlsHandShake(), HandleHandShake(), HandShakeNextStep(), OnReadWhileHandshaking(), OnTimeoutWhileHandshaking(), OnWriteWhileHandshaking(), and SendHSMsg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnHeaderCorruption()

void XrdCl::AsyncSocketHandler::OnHeaderCorruption ( )
protected

Definition at line 785 of file XrdClAsyncSocketHandler.cc.

786 {
787 //--------------------------------------------------------------------------
788 // We need to force a socket error so this is handled in a similar way as
789 // a stream t/o and all requests are retried
790 //--------------------------------------------------------------------------
791 pStream->ForceError( XRootDStatus( stError, errSocketError ) );
792 }
const uint16_t errSocketError

References XrdCl::errSocketError, pStream, and XrdCl::stError.

Referenced by OnRead().

Here is the caller graph for this function:

◆ OnRead()

bool XrdCl::AsyncSocketHandler::OnRead ( )
protected

Definition at line 522 of file XrdClAsyncSocketHandler.cc.

523 {
524 //--------------------------------------------------------------------------
525 // Make sure the response reader object exists
526 //--------------------------------------------------------------------------
527 if( !rspreader )
528 {
529 OnFault( XRootDStatus( stError, errInternal, 0, "Response reader is null." ) );
530 return false;
531 }
532
533 //--------------------------------------------------------------------------
534 // Readout the data from the socket
535 //--------------------------------------------------------------------------
536 XRootDStatus st = rspreader->Read();
537
538 //--------------------------------------------------------------------------
539 // Handler header corruption
540 //--------------------------------------------------------------------------
541 if( !st.IsOK() && st.code == errCorruptedHeader )
542 {
544 return false;
545 }
546
547 //--------------------------------------------------------------------------
548 // Handler other errors
549 //--------------------------------------------------------------------------
550 if( !st.IsOK() )
551 {
552 OnFault( st );
553 return false;
554 }
555
556 //--------------------------------------------------------------------------
557 // We are not done yet
558 //--------------------------------------------------------------------------
559 if( st.code == suRetry ) return true;
560
561 //--------------------------------------------------------------------------
562 // We are done, reset the response reader so we can read out next message
563 //--------------------------------------------------------------------------
564 rspreader->Reset();
565 return true;
566 }
const uint16_t errInternal
Internal error.
const uint16_t errCorruptedHeader

References XrdCl::Status::code, XrdCl::errCorruptedHeader, XrdCl::errInternal, XrdCl::Status::IsOK(), OnFault(), OnHeaderCorruption(), rspreader, XrdCl::stError, and XrdCl::suRetry.

Referenced by EventRead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnReadTimeout()

bool XrdCl::AsyncSocketHandler::OnReadTimeout ( )
protected

Definition at line 763 of file XrdClAsyncSocketHandler.cc.

764 {
765 return pStream->OnReadTimeout( pSubStreamNum );
766 }

References pStream, and pSubStreamNum.

Referenced by EventRead().

Here is the caller graph for this function:

◆ OnReadWhileHandshaking()

bool XrdCl::AsyncSocketHandler::OnReadWhileHandshaking ( )
protected

Definition at line 571 of file XrdClAsyncSocketHandler.cc.

572 {
573 //--------------------------------------------------------------------------
574 // Make sure the response reader object exists
575 //--------------------------------------------------------------------------
576 if( !hsreader )
577 {
578 OnFault( XRootDStatus( stError, errInternal, 0, "Hand-shake reader is null." ) );
579 return false;
580 }
581
582 //--------------------------------------------------------------------------
583 // Read the message and let the transport handler look at it when
584 // reading has finished
585 //--------------------------------------------------------------------------
586 XRootDStatus st = hsreader->Read();
587 if( !st.IsOK() )
588 {
590 return false;
591 }
592
593 if( st.code != suDone )
594 return true;
595
596 return HandleHandShake( hsreader->ReleaseMsg() );
597 }
bool HandleHandShake(std::unique_ptr< Message > msg) XRD_WARN_UNUSED_RESULT

References XrdCl::Status::code, XrdCl::errInternal, HandleHandShake(), hsreader, XrdCl::Status::IsOK(), OnFault(), OnFaultWhileHandshaking(), XrdCl::stError, and XrdCl::suDone.

Referenced by EventRead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTimeoutWhileHandshaking()

bool XrdCl::AsyncSocketHandler::OnTimeoutWhileHandshaking ( )
protected

Definition at line 771 of file XrdClAsyncSocketHandler.cc.

772 {
773 time_t now = time(0);
775 {
777 return false;
778 }
779 return true;
780 }

References XrdCl::errSocketTimeout, OnFaultWhileHandshaking(), pConnectionStarted, pConnectionTimeout, and XrdCl::stError.

Referenced by EventRead(), and EventWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTLSHandShake()

bool XrdCl::AsyncSocketHandler::OnTLSHandShake ( )
inlineprotected

Definition at line 825 of file XrdClAsyncSocketHandler.cc.

826 {
827 XRootDStatus st = DoTlsHandShake();
828 if( !st.IsOK() )
829 return false;
830 if ( st.code == suRetry )
831 return true;
832
833 return HandShakeNextStep( pTransport->HandShakeDone( pHandShakeData.get(),
834 *pChannelData ) );
835 }

References XrdCl::Status::code, DoTlsHandShake(), HandShakeNextStep(), XrdCl::Status::IsOK(), pChannelData, pHandShakeData, pTransport, and XrdCl::suRetry.

Referenced by EventRead(), and EventWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnWrite()

bool XrdCl::AsyncSocketHandler::OnWrite ( )
protected

Definition at line 430 of file XrdClAsyncSocketHandler.cc.

431 {
432 if( !reqwriter )
433 {
434 OnFault( XRootDStatus( stError, errInternal, 0, "Request writer is null." ) );
435 return false;
436 }
437 //--------------------------------------------------------------------------
438 // Let's do the writing ...
439 //--------------------------------------------------------------------------
440 XRootDStatus st = reqwriter->Write();
441
442 //--------------------------------------------------------------------------
443 // In the case of ECONNRESET perhaps the server sent us something.
444 // To give a chance to read it in the next event poll we pass this as a
445 // retry, but return the error after the next event.
446 //--------------------------------------------------------------------------
447 if( st.code == errSocketError && st.errNo == ECONNRESET )
448 {
449 if( (DisableUplink()).IsOK() )
450 {
452 st = XRootDStatus( stOK, suRetry );
453 }
454 }
455 if( !st.IsOK() )
456 {
457 //------------------------------------------------------------------------
458 // We failed
459 //------------------------------------------------------------------------
460 OnFault( st );
461 return false;
462 }
463 //--------------------------------------------------------------------------
464 // We are not done yet
465 //--------------------------------------------------------------------------
466 if( st.code == suRetry) return true;
467 //--------------------------------------------------------------------------
468 // Disable the respective substream if empty
469 //--------------------------------------------------------------------------
470 reqwriter->Reset();
471 pStream->DisableIfEmpty( pSubStreamNum );
472 return true;
473 }
XRootDStatus DisableUplink()
Disable uplink.
const uint16_t stOK
Everything went OK.

References XrdCl::Status::code, DisableUplink(), XrdCl::errInternal, XrdCl::Status::errNo, XrdCl::errSocketError, XrdCl::Status::IsOK(), OnFault(), pReqConnResetError, pStream, pSubStreamNum, reqwriter, XrdCl::stError, XrdCl::stOK, and XrdCl::suRetry.

Referenced by EventWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnWriteTimeout()

bool XrdCl::AsyncSocketHandler::OnWriteTimeout ( )
protected

Definition at line 755 of file XrdClAsyncSocketHandler.cc.

756 {
757 return pStream->OnWriteTimeout( pSubStreamNum );
758 }

References pStream, and pSubStreamNum.

Referenced by EventWrite().

Here is the caller graph for this function:

◆ OnWriteWhileHandshaking()

bool XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking ( )
protected

Definition at line 478 of file XrdClAsyncSocketHandler.cc.

479 {
480 XRootDStatus st;
481 if( !hswriter || !hswriter->HasMsg() )
482 {
483 if( !(st = DisableUplink()).IsOK() )
484 {
486 return false;
487 }
488 return true;
489 }
490 //--------------------------------------------------------------------------
491 // Let's do the writing ...
492 //--------------------------------------------------------------------------
493 st = hswriter->Write();
494 if( !st.IsOK() )
495 {
496 //------------------------------------------------------------------------
497 // We failed
498 //------------------------------------------------------------------------
500 return false;
501 }
502 //--------------------------------------------------------------------------
503 // We are not done yet
504 //--------------------------------------------------------------------------
505 if( st.code == suRetry ) return true;
506 //--------------------------------------------------------------------------
507 // Disable the uplink
508 // Note: at this point we don't deallocate the HS message as we might need
509 // to re-send it in case of a kXR_wait response
510 //--------------------------------------------------------------------------
511 if( !(st = DisableUplink()).IsOK() )
512 {
514 return false;
515 }
516 return true;
517 }

References XrdCl::Status::code, DisableUplink(), hswriter, XrdCl::Status::IsOK(), OnFaultWhileHandshaking(), and XrdCl::suRetry.

Referenced by EventWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendHSMsg()

bool XrdCl::AsyncSocketHandler::SendHSMsg ( )
protected

Definition at line 840 of file XrdClAsyncSocketHandler.cc.

841 {
842 if( !hswriter )
843 {
845 "HS writer object missing!" ) );
846 return false;
847 }
848 //--------------------------------------------------------------------------
849 // We only set a new HS message if this is not a replay due to kXR_wait
850 //--------------------------------------------------------------------------
851 if( !pHSWaitSeconds )
852 {
853 hswriter->Reset( pHandShakeData->out );
854 pHandShakeData->out = nullptr;
855 }
856 //--------------------------------------------------------------------------
857 // otherwise we replay the kXR_endsess request
858 //--------------------------------------------------------------------------
859 else
860 hswriter->Replay();
861 //--------------------------------------------------------------------------
862 // Enable writing so we can replay the HS message
863 //--------------------------------------------------------------------------
864 XRootDStatus st;
865 if( !(st = EnableUplink()).IsOK() )
866 {
868 return false;
869 }
870 return true;
871 }

References EnableUplink(), XrdCl::errInternal, hswriter, OnFaultWhileHandshaking(), pHandShakeData, pHSWaitSeconds, and XrdCl::stError.

Referenced by CheckHSWait(), HandleHandShake(), and HandShakeNextStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAddress()

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

Set address.

Definition at line 64 of file XrdClAsyncSocketHandler.hh.

65 {
66 pSockAddr = address;
67 }

References pSockAddr.

◆ ToStreamName()

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

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

Definition at line 200 of file XrdClAsyncSocketHandler.cc.

201 {
202 std::ostringstream o;
203 o << url.GetHostId();
204 o << "." << strmnb;
205 return o.str();
206 }

References XrdCl::URL::GetHostId().

Referenced by AsyncSocketHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

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

◆ pPoller

Poller* XrdCl::AsyncSocketHandler::pPoller
protected

◆ pReqConnResetError

XRootDStatus XrdCl::AsyncSocketHandler::pReqConnResetError
protected

Definition at line 286 of file XrdClAsyncSocketHandler.hh.

Referenced by Connect(), Event(), and OnWrite().

◆ pSockAddr

XrdNetAddr XrdCl::AsyncSocketHandler::pSockAddr
protected

◆ pSocket

◆ pStream

◆ pStreamName

◆ pSubStreamNum

uint16_t XrdCl::AsyncSocketHandler::pSubStreamNum
protected

◆ pTimeoutResolution

uint16_t XrdCl::AsyncSocketHandler::pTimeoutResolution
protected

◆ pTlsHandShakeOngoing

bool XrdCl::AsyncSocketHandler::pTlsHandShakeOngoing
protected

◆ pTransport

TransportHandler* XrdCl::AsyncSocketHandler::pTransport
protected

◆ pUrl

URL XrdCl::AsyncSocketHandler::pUrl
protected

Definition at line 284 of file XrdClAsyncSocketHandler.hh.

Referenced by AsyncSocketHandler(), and DoTlsHandShake().

◆ reqwriter

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

Definition at line 291 of file XrdClAsyncSocketHandler.hh.

Referenced by HandShakeNextStep(), and OnWrite().

◆ rspreader

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

Definition at line 289 of file XrdClAsyncSocketHandler.hh.

Referenced by HandShakeNextStep(), and OnRead().


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