XrdCl::Channel Class Reference

A communication channel between the client and the server. More...

#include <XrdClChannel.hh>

Collaboration diagram for XrdCl::Channel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Channel (const URL &url, Poller *poller, TransportHandler *transport, TaskManager *taskManager, JobManager *jobManager)
 ~Channel ()
 Destructor.
const URLGetURL () const
 Get the URL.
Status Send (Message *msg, bool stateful, time_t expires)
Status Send (Message *msg, OutgoingMsgHandler *handler, bool stateful, time_t expires)
Status Receive (Message *&msg, MessageFilter *filter, time_t expires)
Status Receive (IncomingMsgHandler *handler, time_t expires)
Status QueryTransport (uint16_t query, AnyObject &result)
void RegisterEventHandler (ChannelEventHandler *handler)
 Register channel event handler.
void RemoveEventHandler (ChannelEventHandler *handler)
 Remove a channel event handler.
void Tick (time_t now)
 Handle a time event.
Status ForceDisconnect ()
 Force disconnect of all streams.
uint16_t NbConnectedStrm ()
 Get the number of connected data streams.
void SetOnConnectHandler (Job *onConnJob)
 Set the on-connect handler for data streams.

Private Attributes

URL pUrl
PollerpPoller
TransportHandlerpTransport
TaskManagerpTaskManager
std::vector< Stream * > pStreams
XrdSysMutex pMutex
AnyObject pChannelData
InQueue pIncoming
TickGeneratorTask * pTickGenerator
JobManagerpJobManager

Detailed Description

A communication channel between the client and the server.


Constructor & Destructor Documentation

XrdCl::Channel::Channel ( const URL url,
Poller poller,
TransportHandler transport,
TaskManager taskManager,
JobManager jobManager 
)

Constructor

Parameters:
url address of the server to connect to
poller poller object to be used for non-blocking IO
transport protocol specific transport handler
taskManager async task handler to be used by the channel
jobManager worker thread handler to be used by the channel
XrdCl::Channel::~Channel (  ) 

Destructor.


Member Function Documentation

Status XrdCl::Channel::ForceDisconnect (  ) 

Force disconnect of all streams.

const URL& XrdCl::Channel::GetURL (  )  const [inline]

Get the URL.

References pUrl.

uint16_t XrdCl::Channel::NbConnectedStrm (  ) 

Get the number of connected data streams.

Status XrdCl::Channel::QueryTransport ( uint16_t  query,
AnyObject result 
)

Query the transport handler

Parameters:
query the query as defined in the TransportQuery struct or others that may be recognized by the protocol transport
result the result of the query
Returns:
status of the query
Status XrdCl::Channel::Receive ( IncomingMsgHandler handler,
time_t  expires 
)

Listen to incoming messages, the listener is notified when a new message arrives and when the timeout passes

Parameters:
handler handler to be notified about new messages
expires expiration timestamp
Returns:
success when the handler has been registered correctly
Status XrdCl::Channel::Receive ( Message *&  msg,
MessageFilter filter,
time_t  expires 
)

Synchronously receive a message - blocks until a message matching a filter is found in the incoming queue or the timeout passes

Parameters:
msg reference to a message pointer, the pointer will point to the received message
filter filter object defining what to look for
expires expiration timestamp
Returns:
success when the message has been received successfully, failure otherwise
void XrdCl::Channel::RegisterEventHandler ( ChannelEventHandler handler  ) 

Register channel event handler.

void XrdCl::Channel::RemoveEventHandler ( ChannelEventHandler handler  ) 

Remove a channel event handler.

Status XrdCl::Channel::Send ( Message msg,
OutgoingMsgHandler handler,
bool  stateful,
time_t  expires 
)

Send the message asynchronously - the message is inserted into the send queue and a listener is called when the message is successfully pushed through the wire or when the timeout elapses

Parameters:
msg message to be sent stateful physical stream disconnection causes an error
expires unix timestamp after which a failure is reported to the listener
handler handler to be notified about the status
redirector virtual redirector to be used
Returns:
success if the message was successfully inserted into the send queues, failure otherwise
Status XrdCl::Channel::Send ( Message msg,
bool  stateful,
time_t  expires 
)

Send a message synchronously - synchronously means that it will block until the message is written to a socket

Parameters:
msg message to be sent
expires expiration timestamp after which a failure should be reported if sending was unsuccessful
stateful physical stream disconnection causes an error
Returns:
success if the message has been pushed through the wire, failure otherwise
void XrdCl::Channel::SetOnConnectHandler ( Job onConnJob  ) 

Set the on-connect handler for data streams.

void XrdCl::Channel::Tick ( time_t  now  ) 

Handle a time event.


Member Data Documentation

std::vector<Stream *> XrdCl::Channel::pStreams [private]
TickGeneratorTask* XrdCl::Channel::pTickGenerator [private]

Referenced by GetURL().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 21 May 2020 for xrootd by  doxygen 1.6.1