XrdCl::IncomingMsgHandler Class Reference

Message handler. More...

#include <XrdClPostMasterInterfaces.hh>

List of all members.

Public Types

 Take = 0x0001
 Take ownership over the message.
 Ignore = 0x0002
 Ignore the message.
 RemoveHandler = 0x0004
 Raw = 0x0008
 NoProcess = 0x0010
 Ready = 1
 The stream has become connected.
 Broken = 2
 The stream is broken.
 Timeout = 3
 The declared timeout has occurred.
 FatalError = 4
 Stream has been broken and won't be recovered.
enum  Action {
  Take = 0x0001, Ignore = 0x0002, RemoveHandler = 0x0004, Raw = 0x0008,
  NoProcess = 0x0010
}
 Actions to be taken after a message is processed by the handler. More...
enum  StreamEvent { Ready = 1, Broken = 2, Timeout = 3, FatalError = 4 }
 Events that may have occurred to the stream. More...

Public Member Functions

virtual ~IncomingMsgHandler ()
 Event types that the message handler may receive.
virtual uint16_t Examine (Message *msg)=0
virtual void Process (Message *msg)
virtual Status ReadMessageBody (Message *msg, int socket, uint32_t &bytesRead)
virtual uint8_t OnStreamEvent (StreamEvent event, uint16_t streamNum, Status status)


Detailed Description

Message handler.


Member Enumeration Documentation

enum XrdCl::IncomingMsgHandler::Action

Actions to be taken after a message is processed by the handler.

Enumerator:
Take  Take ownership over the message.
Ignore  Ignore the message.
RemoveHandler  Remove the handler from the notification list
Raw  the handler is interested in reading the message body directly from the socket
NoProcess  don't call the processing callback even if the message belongs to this handler

enum XrdCl::IncomingMsgHandler::StreamEvent

Events that may have occurred to the stream.

Enumerator:
Ready  The stream has become connected.
Broken  The stream is broken.
Timeout  The declared timeout has occurred.
FatalError  Stream has been broken and won't be recovered.


Constructor & Destructor Documentation

virtual XrdCl::IncomingMsgHandler::~IncomingMsgHandler (  )  [inline, virtual]

Event types that the message handler may receive.


Member Function Documentation

virtual uint16_t XrdCl::IncomingMsgHandler::Examine ( Message msg  )  [pure virtual]

Examine an incoming message, and decide on the action to be taken

Parameters:
msg the message, may be zero if receive failed
Returns:
action type that needs to be take wrt the message and the handler

virtual uint8_t XrdCl::IncomingMsgHandler::OnStreamEvent ( StreamEvent  event,
uint16_t  streamNum,
Status  status 
) [inline, virtual]

Handle an event other that a message arrival

Parameters:
event type of the event
streamNum stream concerned
status status info
Returns:
Action::RemoveHandler or 0

virtual void XrdCl::IncomingMsgHandler::Process ( Message msg  )  [inline, virtual]

Process the message if it was "taken" by the examine action

Parameters:
msg the message to be processed

virtual Status XrdCl::IncomingMsgHandler::ReadMessageBody ( Message msg,
int  socket,
uint32_t &  bytesRead 
) [inline, virtual]

Read message body directly from a socket - called if Examine returns Raw flag - only socket related errors may be returned here

Parameters:
msg the corresponding message header
socket the socket to read from
bytesRead number of bytes read by the method
Returns:
stOK & suDone if the whole body has been processed stOK & suRetry if more data is needed stError on failure


The documentation for this class was generated from the following file:
Generated on 12 Dec 2014 for xrootd by  doxygen 1.4.7