xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Private Member Functions | Private 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]

Classes

class  WaitTask
 

Public Member Functions

 AsyncSocketHandler (Poller *poller, TransportHandler *transport, AnyObject *channelData, uint16_t subStreamNum)
 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...
 
Status Connect (time_t timeout)
 Connect to the currently set address. More...
 
Status Close ()
 Close the connection. More...
 
void SetStream (Stream *stream)
 Set a stream object to be notified about the status of the operations. More...
 
virtual void Event (uint8_t type, XrdCl::Socket *)
 Handle a socket event. More...
 
Status EnableUplink ()
 Enable uplink. More...
 
Status DisableUplink ()
 Disable uplink. More...
 
const std::string & GetStreamName ()
 Get stream name. More...
 
time_t GetLastActivity ()
 Get timestamp of last registered socket activity. More...
 
- Public Member Functions inherited from XrdCl::SocketHandler
virtual ~SocketHandler ()
 
virtual void Initialize (Poller *)
 Initializer. More...
 
virtual void Finalize ()
 Finalizer. More...
 

Private Member Functions

void OnConnectionReturn ()
 
void OnWrite ()
 
void OnWriteWhileHandshaking ()
 
Status WriteMessageAndRaw (Message *toWrite, Message *&sign)
 
Status WriteSeparately (Message *toWrite, Message *&sign)
 
Status WriteCurrentMessage (Message *toWrite)
 
Status WriteVMessage (Message *toWrite, Message *&sign, ChunkList *chunks, uint32_t *asyncOffset)
 
void OnRead ()
 
void OnReadWhileHandshaking ()
 
Status ReadMessage (Message *&toRead)
 
void OnFault (Status st)
 
void OnFaultWhileHandshaking (Status st)
 
void OnWriteTimeout ()
 
void OnReadTimeout ()
 
void OnTimeoutWhileHandshaking ()
 
Status GetSignature (Message *toSign, Message *&sign)
 
void ToIov (Message &msg, iovec &iov)
 
void UpdateAfterWrite (Message &msg, iovec &iov, int &bytesRead)
 
uint32_t ToIov (ChunkList *chunks, const uint32_t *offset, iovec *iov)
 
void UpdateAfterWrite (ChunkList *chunks, uint32_t *offset, iovec *iov, int &bytesWritten)
 
void RetryHSMsg (Message *msg)
 
kXR_int32 HandleWaitRsp (Message *rsp)
 
Status ClassifyErrno (int error)
 

Private Attributes

PollerpPoller
 
TransportHandlerpTransport
 
AnyObjectpChannelData
 
uint16_t pSubStreamNum
 
StreampStream
 
std::string pStreamName
 
SocketpSocket
 
MessagepIncoming
 
MessagepHSIncoming
 
MessagepOutgoing
 
MessagepSignature
 
MessagepHSOutgoing
 
XrdNetAddr pSockAddr
 
HandShakeDatapHandShakeData
 
bool pHandShakeDone
 
uint16_t pTimeoutResolution
 
time_t pConnectionStarted
 
time_t pConnectionTimeout
 
bool pHeaderDone
 
std::pair< IncomingMsgHandler
*, bool > 
pIncHandler
 
bool pOutMsgDone
 
OutgoingMsgHandlerpOutHandler
 
uint32_t pIncMsgSize
 
uint32_t pOutMsgSize
 
time_t pLastActivity
 

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 ( Poller poller,
TransportHandler transport,
AnyObject channelData,
uint16_t  subStreamNum 
)

Constructor.

XrdCl::AsyncSocketHandler::~AsyncSocketHandler ( )

Destructor.

Member Function Documentation

Status XrdCl::AsyncSocketHandler::ClassifyErrno ( int  error)
private

Classify errno while reading/writing

Once we are at R5, change Transport interface and use: Transport::ClassifyErrno

Status XrdCl::AsyncSocketHandler::Close ( )

Close the connection.

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

Connect to the currently set address.

Status XrdCl::AsyncSocketHandler::DisableUplink ( )
inline
Status XrdCl::AsyncSocketHandler::EnableUplink ( )
inline
virtual void XrdCl::AsyncSocketHandler::Event ( uint8_t  type,
XrdCl::Socket  
)
virtual

Handle a socket event.

Implements XrdCl::SocketHandler.

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

Get the address that the socket is connected to.

References pSockAddr.

time_t XrdCl::AsyncSocketHandler::GetLastActivity ( )
inline

Get timestamp of last registered socket activity.

References pLastActivity.

Status XrdCl::AsyncSocketHandler::GetSignature ( Message toSign,
Message *&  sign 
)
private
const std::string& XrdCl::AsyncSocketHandler::GetStreamName ( )
inline

Get stream name.

References pStreamName.

kXR_int32 XrdCl::AsyncSocketHandler::HandleWaitRsp ( Message rsp)
inlineprivate
void XrdCl::AsyncSocketHandler::OnConnectionReturn ( )
private
void XrdCl::AsyncSocketHandler::OnFault ( Status  st)
private
void XrdCl::AsyncSocketHandler::OnFaultWhileHandshaking ( Status  st)
private
void XrdCl::AsyncSocketHandler::OnRead ( )
private
void XrdCl::AsyncSocketHandler::OnReadTimeout ( )
private
void XrdCl::AsyncSocketHandler::OnReadWhileHandshaking ( )
private
void XrdCl::AsyncSocketHandler::OnTimeoutWhileHandshaking ( )
private
void XrdCl::AsyncSocketHandler::OnWrite ( )
private
void XrdCl::AsyncSocketHandler::OnWriteTimeout ( )
private
void XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking ( )
private
Status XrdCl::AsyncSocketHandler::ReadMessage ( Message *&  toRead)
private
void XrdCl::AsyncSocketHandler::RetryHSMsg ( Message msg)
private
void XrdCl::AsyncSocketHandler::SetAddress ( const XrdNetAddr address)
inline

Set address.

References pSockAddr.

void XrdCl::AsyncSocketHandler::SetStream ( Stream stream)

Set a stream object to be notified about the status of the operations.

void XrdCl::AsyncSocketHandler::ToIov ( Message msg,
iovec &  iov 
)
inlineprivate
uint32_t XrdCl::AsyncSocketHandler::ToIov ( ChunkList chunks,
const uint32_t *  offset,
iovec *  iov 
)
inlineprivate
void XrdCl::AsyncSocketHandler::UpdateAfterWrite ( Message msg,
iovec &  iov,
int &  bytesRead 
)
inlineprivate
void XrdCl::AsyncSocketHandler::UpdateAfterWrite ( ChunkList chunks,
uint32_t *  offset,
iovec *  iov,
int &  bytesWritten 
)
inlineprivate
Status XrdCl::AsyncSocketHandler::WriteCurrentMessage ( Message toWrite)
private
Status XrdCl::AsyncSocketHandler::WriteMessageAndRaw ( Message toWrite,
Message *&  sign 
)
private
Status XrdCl::AsyncSocketHandler::WriteSeparately ( Message toWrite,
Message *&  sign 
)
private
Status XrdCl::AsyncSocketHandler::WriteVMessage ( Message toWrite,
Message *&  sign,
ChunkList chunks,
uint32_t *  asyncOffset 
)
private

Member Data Documentation

AnyObject* XrdCl::AsyncSocketHandler::pChannelData
private
time_t XrdCl::AsyncSocketHandler::pConnectionStarted
private
time_t XrdCl::AsyncSocketHandler::pConnectionTimeout
private
HandShakeData* XrdCl::AsyncSocketHandler::pHandShakeData
private
bool XrdCl::AsyncSocketHandler::pHandShakeDone
private
bool XrdCl::AsyncSocketHandler::pHeaderDone
private
Message* XrdCl::AsyncSocketHandler::pHSIncoming
private
Message* XrdCl::AsyncSocketHandler::pHSOutgoing
private
std::pair<IncomingMsgHandler*, bool> XrdCl::AsyncSocketHandler::pIncHandler
private
uint32_t XrdCl::AsyncSocketHandler::pIncMsgSize
private
Message* XrdCl::AsyncSocketHandler::pIncoming
private
time_t XrdCl::AsyncSocketHandler::pLastActivity
private

Referenced by GetLastActivity().

Message* XrdCl::AsyncSocketHandler::pOutgoing
private
OutgoingMsgHandler* XrdCl::AsyncSocketHandler::pOutHandler
private
bool XrdCl::AsyncSocketHandler::pOutMsgDone
private
uint32_t XrdCl::AsyncSocketHandler::pOutMsgSize
private
Poller* XrdCl::AsyncSocketHandler::pPoller
private

Referenced by DisableUplink(), and EnableUplink().

Message* XrdCl::AsyncSocketHandler::pSignature
private
XrdNetAddr XrdCl::AsyncSocketHandler::pSockAddr
private

Referenced by GetAddress(), and SetAddress().

Socket* XrdCl::AsyncSocketHandler::pSocket
private

Referenced by DisableUplink(), and EnableUplink().

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

Referenced by GetStreamName().

uint16_t XrdCl::AsyncSocketHandler::pSubStreamNum
private
uint16_t XrdCl::AsyncSocketHandler::pTimeoutResolution
private

Referenced by EnableUplink().

TransportHandler* XrdCl::AsyncSocketHandler::pTransport
private

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