#include <XrdClChannel.hh>
Public Member Functions | |
| Channel (const URL &url, Poller *poller, TransportHandler *transport, TaskManager *taskManager, JobManager *jobManager, const URL &prefurl=URL()) | |
| ~Channel () | |
| Destructor. | |
| bool | CanCollapse (const URL &url) |
| void | DecFileInstCnt () |
| Decrement file object instance count bound to this channel. | |
| void | Finalize () |
| Status | ForceDisconnect () |
| Force disconnect of all streams. | |
| Status | ForceDisconnect (bool hush) |
| Force disconnect of all streams. | |
| Status | ForceDisconnect (std::shared_ptr< Channel > self, const uint64_t sess) |
| Status | ForceReconnect () |
| Force reconnect. | |
| const URL & | GetURL () const |
| Get the URL. | |
| uint16_t | NbConnectedStrm () |
| Get the number of connected data streams. | |
| Status | QueryTransport (uint16_t query, AnyObject &result) |
| void | RegisterEventHandler (ChannelEventHandler *handler) |
| Register channel event handler. | |
| void | RemoveEventHandler (ChannelEventHandler *handler) |
| Remove a channel event handler. | |
| XRootDStatus | Send (Message *msg, MsgHandler *handler, bool stateful, time_t expires) |
| void | SetOnDataConnectHandler (std::shared_ptr< Job > &onConnJob) |
| Set the on-connect handler for data streams. | |
| void | SetSelf (std::shared_ptr< Channel > &self) |
| Gives us access to the shared pointer that the postmaster holds for us. | |
| void | Tick (time_t now) |
| Handle a time event. | |
A communication channel between the client and the server
Notes on ownership. The Channel is owned via shared_ptr usually held by at least PostMaster. Channels replaced during a RedirectCollapse may no longer be held by PostMaster. Channel has a weak_ptr to its shared_ptr (pSelf). Channel owns a Stream, which also holds a weak_ptr for its owning Channel. The Stream owns a number of AsyncSocketHandler (one for each substream). After Connect() the SocketHandler will hold a shared_ptr for Channel until the SocketHandler is Closed. Thus lifetime of Channel ends when PostMaster gives up holding the Channel and all AsyncSocketHandler Close connections. PostMaster also maintains a set of non-owning Channel* for live Channel objects, for PostMaster::Finalize() to use to issue Finalize() on any live Channels.
Definition at line 61 of file XrdClChannel.hh.
| XrdCl::Channel::Channel | ( | const URL & | url, |
| Poller * | poller, | ||
| TransportHandler * | transport, | ||
| TaskManager * | taskManager, | ||
| JobManager * | jobManager, | ||
| const URL & | prefurl = URL() ) |
Constructor
| 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 |
Definition at line 84 of file XrdClChannel.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultTimeoutResolution, XrdCl::URL::GetChannelId(), XrdCl::DefaultEnv::GetEnv(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetParams(), XrdCl::URL::GetProtocol(), and XrdCl::PostMasterMsg.
| XrdCl::Channel::~Channel | ( | ) |
Destructor.
Definition at line 132 of file XrdClChannel.cc.
| bool XrdCl::Channel::CanCollapse | ( | const URL & | url | ) |
Definition at line 230 of file XrdClChannel.cc.
| void XrdCl::Channel::DecFileInstCnt | ( | ) |
Decrement file object instance count bound to this channel.
Definition at line 238 of file XrdClChannel.cc.
| void XrdCl::Channel::Finalize | ( | ) |
Used by the PostMaster to indicate the Channel should release all resources. It should be assumed that the jobmanager has already been stopped & finalized and the poller and taskmanager have been stopped.
Definition at line 162 of file XrdClChannel.cc.
| Status XrdCl::Channel::ForceDisconnect | ( | ) |
Force disconnect of all streams.
Definition at line 170 of file XrdClChannel.cc.
References ForceDisconnect().
Referenced by ForceDisconnect().
| Status XrdCl::Channel::ForceDisconnect | ( | bool | hush | ) |
Force disconnect of all streams.
Definition at line 178 of file XrdClChannel.cc.
References XrdCl::errOperationInterrupted, and XrdCl::stError.
Force disconnect of all streams. This was triggered internally, e.g. by one of our Streams.
Definition at line 191 of file XrdClChannel.cc.
References XrdCl::errOperationInterrupted, and XrdCl::stError.
| Status XrdCl::Channel::ForceReconnect | ( | ) |
Force reconnect.
Definition at line 205 of file XrdClChannel.cc.
|
inline |
| uint16_t XrdCl::Channel::NbConnectedStrm | ( | ) |
Get the number of connected data streams.
Definition at line 214 of file XrdClChannel.cc.
References XrdCl::XRootDTransport::NbConnectedStrm().
Query the transport handler
| 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 |
Definition at line 246 of file XrdClChannel.cc.
| void XrdCl::Channel::RegisterEventHandler | ( | ChannelEventHandler * | handler | ) |
Register channel event handler.
Definition at line 256 of file XrdClChannel.cc.
| void XrdCl::Channel::RemoveEventHandler | ( | ChannelEventHandler * | handler | ) |
Remove a channel event handler.
Definition at line 264 of file XrdClChannel.cc.
| XRootDStatus XrdCl::Channel::Send | ( | Message * | msg, |
| MsgHandler * | 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
| msg | message to be sent |
| handler | handler to be notified about the status |
| stateful | physical stream disconnection causes an error |
| expires | unix timestamp after which a failure is reported to the listener |
Definition at line 142 of file XrdClChannel.cc.
| void XrdCl::Channel::SetOnDataConnectHandler | ( | std::shared_ptr< Job > & | onConnJob | ) |
Set the on-connect handler for data streams.
Definition at line 222 of file XrdClChannel.cc.
| void XrdCl::Channel::SetSelf | ( | std::shared_ptr< Channel > & | self | ) |
Gives us access to the shared pointer that the postmaster holds for us.
Definition at line 269 of file XrdClChannel.cc.
| void XrdCl::Channel::Tick | ( | time_t | now | ) |
Handle a time event.
Definition at line 154 of file XrdClChannel.cc.