xrootd
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, const URL &prefurl=URL())
 
 ~Channel ()
 Destructor. More...
 
const URLGetURL () const
 Get the URL. More...
 
XRootDStatus Send (Message *msg, bool stateful, time_t expires)
 
XRootDStatus 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 SetOnDataConnectHandler (std::shared_ptr< Job > &onConnJob)
 Set the on-connect handler for data streams. More...
 
bool CanCollapse (const URL &url)
 

Private Attributes

URL pUrl
 
PollerpPoller
 
TransportHandlerpTransport
 
TaskManagerpTaskManager
 
StreampStream
 
XrdSysMutex pMutex
 
AnyObject pChannelData
 
InQueue pIncoming
 
TickGeneratorTask * pTickGenerator
 
JobManagerpJobManager
 

Detailed Description

A communication channel between the client and the server.

Constructor & Destructor Documentation

◆ Channel()

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

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

◆ ~Channel()

XrdCl::Channel::~Channel ( )

Destructor.

Member Function Documentation

◆ CanCollapse()

bool XrdCl::Channel::CanCollapse ( const URL url)
Returns
: true if this channel can be collapsed using this URL, false otherwise

◆ ForceDisconnect()

Status XrdCl::Channel::ForceDisconnect ( )

Force disconnect of all streams.

◆ GetURL()

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

Get the URL.

References pUrl.

◆ NbConnectedStrm()

uint16_t XrdCl::Channel::NbConnectedStrm ( )

Get the number of connected data streams.

◆ QueryTransport()

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

◆ Receive() [1/2]

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

◆ Receive() [2/2]

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

◆ RegisterEventHandler()

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

Register channel event handler.

◆ RemoveEventHandler()

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

Remove a channel event handler.

◆ Send() [1/2]

XRootDStatus 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

◆ Send() [2/2]

XRootDStatus 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

◆ SetOnDataConnectHandler()

void XrdCl::Channel::SetOnDataConnectHandler ( std::shared_ptr< Job > &  onConnJob)

Set the on-connect handler for data streams.

◆ Tick()

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

Handle a time event.

Member Data Documentation

◆ pChannelData

AnyObject XrdCl::Channel::pChannelData
private

◆ pIncoming

InQueue XrdCl::Channel::pIncoming
private

◆ pJobManager

JobManager* XrdCl::Channel::pJobManager
private

◆ pMutex

XrdSysMutex XrdCl::Channel::pMutex
private

◆ pPoller

Poller* XrdCl::Channel::pPoller
private

◆ pStream

Stream* XrdCl::Channel::pStream
private

◆ pTaskManager

TaskManager* XrdCl::Channel::pTaskManager
private

◆ pTickGenerator

TickGeneratorTask* XrdCl::Channel::pTickGenerator
private

◆ pTransport

TransportHandler* XrdCl::Channel::pTransport
private

◆ pUrl

URL XrdCl::Channel::pUrl
private

Referenced by GetURL().


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