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

Public Member Functions

 Channel (const URL &url, Poller *poller, TransportHandler *transport, TaskManager *taskManager, JobManager *jobManager)
 
 ~Channel ()
 Destructor. More...
 
const URLGetURL () const
 Get the URL. More...
 
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. More...
 
void RemoveEventHandler (ChannelEventHandler *handler)
 Remove a channel event handler. More...
 
void Tick (time_t now)
 Handle a time event. More...
 
Status ForceDisconnect ()
 Force disconnect of all streams. More...
 
uint16_t NbConnectedStrm ()
 Get the number of connected data streams. More...
 
void SetOnConnectHandler (Job *onConnJob)
 Set the on-connect handler for data streams. More...
 

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
urladdress of the server to connect to
pollerpoller object to be used for non-blocking IO
transportprotocol specific transport handler
taskManagerasync task handler to be used by the channel
jobManagerworker 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
querythe query as defined in the TransportQuery struct or others that may be recognized by the protocol transport
resultthe result of the query
Returns
status of the query
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
msgreference to a message pointer, the pointer will point to the received message
filterfilter object defining what to look for
expiresexpiration timestamp
Returns
success when the message has been received successfully, failure otherwise
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
handlerhandler to be notified about new messages
expiresexpiration timestamp
Returns
success when the handler has been registered correctly
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,
bool  stateful,
time_t  expires 
)

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

Parameters
msgmessage to be sent
expiresexpiration timestamp after which a failure should be reported if sending was unsuccessful
statefulphysical stream disconnection causes an error
Returns
success if the message has been pushed through the wire, failure otherwise
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
msgmessage to be sent stateful physical stream disconnection causes an error
expiresunix timestamp after which a failure is reported to the listener
handlerhandler to be notified about the status
redirectorvirtual redirector to be used
Returns
success if the message was successfully inserted into the send queues, 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

AnyObject XrdCl::Channel::pChannelData
private
InQueue XrdCl::Channel::pIncoming
private
JobManager* XrdCl::Channel::pJobManager
private
XrdSysMutex XrdCl::Channel::pMutex
private
Poller* XrdCl::Channel::pPoller
private
std::vector<Stream *> XrdCl::Channel::pStreams
private
TaskManager* XrdCl::Channel::pTaskManager
private
TickGeneratorTask* XrdCl::Channel::pTickGenerator
private
TransportHandler* XrdCl::Channel::pTransport
private
URL XrdCl::Channel::pUrl
private

Referenced by GetURL().


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