A hub for dispatching and receiving messages. More...
#include <XrdClPostMaster.hh>
Public Member Functions | |
| PostMaster () | |
| Constructor. | |
| virtual | ~PostMaster () |
| Destructor. | |
| void | CollapseRedirect (const URL &oldurl, const URL &newURL) |
| Collapse channel URL - replace the URL of the channel. | |
| void | DecFileInstCnt (const URL &url) |
| Decrement file object instance count bound to this channel. | |
| bool | Finalize () |
| Finalizer. | |
| Status | ForceDisconnect (const URL &url) |
| Shut down a channel. | |
| Status | ForceDisconnect (const URL &url, bool hush) |
| Shut down a channel. | |
| Status | ForceDisconnect (std::shared_ptr< Channel > channel, const uint64_t sess) |
| Shut down a channel. This version is used by the channel itself. | |
| Status | ForceReconnect (const URL &url) |
| Reconnect the channel. | |
| JobManager * | GetJobManager () |
| Get the job manager object user by the post master. | |
| TaskManager * | GetTaskManager () |
| Get the task manager object user by the post master. | |
| bool | Initialize () |
| Initializer. | |
| bool | IsRunning () |
| uint16_t | NbConnectedStrm (const URL &url) |
| Get the number of connected data streams. | |
| void | NotifyConnectHandler (const URL &url) |
| Notify the global on-connect handler. | |
| void | NotifyConnErrHandler (const URL &url, const XRootDStatus &status) |
| Notify the global error connection handler. | |
| Status | QueryTransport (const URL &url, uint16_t query, AnyObject &result) |
| Status | Redirect (const URL &url, Message *msg, MsgHandler *handler) |
| Status | RegisterEventHandler (const URL &url, ChannelEventHandler *handler) |
| Register channel event handler. | |
| bool | Reinitialize () |
| Reinitialize after fork. | |
| Status | RemoveEventHandler (const URL &url, ChannelEventHandler *handler) |
| Remove a channel event handler. | |
| XRootDStatus | Send (const URL &url, Message *msg, MsgHandler *handler, bool stateful, time_t expires) |
| void | SetConnectionErrorHandler (std::function< void(const URL &, const XRootDStatus &)> handler) |
| Set the global on-error on-connect handler for control streams. | |
| void | SetOnConnectHandler (std::unique_ptr< Job > onConnJob) |
| Set the global connection error handler. | |
| void | SetOnDataConnectHandler (const URL &url, std::shared_ptr< Job > onConnJob) |
| Set the on-connect handler for data streams. | |
| bool | Start () |
| Start the post master. | |
| bool | Stop () |
| Stop the postmaster. | |
A hub for dispatching and receiving messages.
Definition at line 47 of file XrdClPostMaster.hh.
| XrdCl::PostMaster::PostMaster | ( | ) |
Constructor.
Definition at line 127 of file XrdClPostMaster.cc.
|
virtual |
Collapse channel URL - replace the URL of the channel.
Definition at line 478 of file XrdClPostMaster.cc.
References CollapseRedirect(), XrdCl::Log::Error(), XrdCl::URL::GetChannelId(), XrdCl::TransportManager::GetHandler(), XrdCl::URL::GetHostId(), XrdCl::DefaultEnv::GetLog(), XrdCl::URL::GetProtocol(), XrdCl::DefaultEnv::GetTransportManager(), XrdCl::Log::Info(), XrdSysMutexHelper::Lock(), XrdCl::PostMasterMsg, and XrdSysMutexHelper::UnLock().
Referenced by CollapseRedirect().
| void XrdCl::PostMaster::DecFileInstCnt | ( | const URL & | url | ) |
Decrement file object instance count bound to this channel.
Definition at line 546 of file XrdClPostMaster.cc.
Referenced by XrdCl::FileStateHandler::~FileStateHandler().
| bool XrdCl::PostMaster::Finalize | ( | ) |
Finalizer.
Definition at line 168 of file XrdClPostMaster.cc.
Referenced by XrdCl::DefaultEnv::GetPostMaster().
Shut down a channel.
Definition at line 345 of file XrdClPostMaster.cc.
References ForceDisconnect().
Referenced by ForceDisconnect(), and XrdCl::Stream::OnReadTimeout().
Shut down a channel.
Definition at line 353 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::URL::GetChannelId(), and XrdCl::stError.
| Status XrdCl::PostMaster::ForceDisconnect | ( | std::shared_ptr< Channel > | channel, |
| const uint64_t | sess ) |
Shut down a channel. This version is used by the channel itself.
Definition at line 374 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, and XrdCl::stError.
Reconnect the channel.
Definition at line 393 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::URL::GetChannelId(), and XrdCl::stError.
| JobManager * XrdCl::PostMaster::GetJobManager | ( | ) |
Get the job manager object user by the post master.
Definition at line 337 of file XrdClPostMaster.cc.
Referenced by XrdCl::FileStateHandler::Close(), XrdCl::Operation< HasHndl >::Run(), XrdEc::ScheduleHandler(), XrdEc::ScheduleHandler(), and XrdCl::FileStateHandler::TimeOutRequests().
| TaskManager * XrdCl::PostMaster::GetTaskManager | ( | ) |
Get the task manager object user by the post master.
Definition at line 329 of file XrdClPostMaster.cc.
Referenced by XrdCl::DefaultEnv::GetPostMaster().
| bool XrdCl::PostMaster::Initialize | ( | ) |
Initializer.
Definition at line 141 of file XrdClPostMaster.cc.
References XrdCl::PollerFactory::CreatePoller(), XrdCl::DefaultPollerPreference, XrdCl::DefaultEnv::GetEnv(), and XrdCl::Env::GetString().
Referenced by XrdCl::DefaultEnv::GetPostMaster().
| bool XrdCl::PostMaster::IsRunning | ( | ) |
Definition at line 558 of file XrdClPostMaster.cc.
| uint16_t XrdCl::PostMaster::NbConnectedStrm | ( | const URL & | url | ) |
Get the number of connected data streams.
Definition at line 413 of file XrdClPostMaster.cc.
| void XrdCl::PostMaster::NotifyConnectHandler | ( | const URL & | url | ) |
Notify the global on-connect handler.
Definition at line 452 of file XrdClPostMaster.cc.
Referenced by XrdCl::Stream::OnConnect().
| void XrdCl::PostMaster::NotifyConnErrHandler | ( | const URL & | url, |
| const XRootDStatus & | status ) |
Notify the global error connection handler.
Definition at line 465 of file XrdClPostMaster.cc.
Referenced by XrdCl::Stream::OnConnectError().
Query the transport handler for a given URL
| url | the channel to be queried |
| 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 276 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::errNotSupported, XrdCl::URL::GetChannelId(), and XrdCl::stError.
Referenced by XrdCl::FileSystem::DirList(), and XrdCl::FileStateHandler::PgRead().
| Status XrdCl::PostMaster::Redirect | ( | const URL & | url, |
| Message * | msg, | ||
| MsgHandler * | handler ) |
Definition at line 262 of file XrdClPostMaster.cc.
References XrdCl::errInvalidOp, XrdCl::RedirectorRegistry::Get(), XrdCl::VirtualRedirector::HandleRequest(), XrdCl::RedirectorRegistry::Instance(), and XrdCl::stError.
Referenced by XrdCl::MessageUtils::RedirectMessage().
| Status XrdCl::PostMaster::RegisterEventHandler | ( | const URL & | url, |
| ChannelEventHandler * | handler ) |
Register channel event handler.
Definition at line 299 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, and XrdCl::stError.
| bool XrdCl::PostMaster::Reinitialize | ( | ) |
Reinitialize after fork.
Definition at line 240 of file XrdClPostMaster.cc.
| Status XrdCl::PostMaster::RemoveEventHandler | ( | const URL & | url, |
| ChannelEventHandler * | handler ) |
Remove a channel event handler.
Definition at line 314 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, and XrdCl::stError.
| XRootDStatus XrdCl::PostMaster::Send | ( | const URL & | url, |
| 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 succesfsully pushed through the wire or when the timeout elapses
DEADLOCK WARNING: no lock should be taken while calling this method that are used in the callback as well.
| url | recipient of the message |
| msg | message to be sent |
| expires | unix timestamp after which a failure is reported to the handler |
| handler | handler will be notified about the status |
| stateful | physical stream disconnection causes an error |
Definition at line 248 of file XrdClPostMaster.cc.
References XrdCl::errNotSupported, and XrdCl::stError.
Referenced by XrdCl::MessageUtils::SendMessage().
| void XrdCl::PostMaster::SetConnectionErrorHandler | ( | std::function< void(const URL &, const XRootDStatus &)> | handler | ) |
Set the global on-error on-connect handler for control streams.
Definition at line 443 of file XrdClPostMaster.cc.
| void XrdCl::PostMaster::SetOnConnectHandler | ( | std::unique_ptr< Job > | onConnJob | ) |
Set the global connection error handler.
Set the global on-connect handler for control streams.
Definition at line 434 of file XrdClPostMaster.cc.
Referenced by XrdPosixConfig::conTracker().
| void XrdCl::PostMaster::SetOnDataConnectHandler | ( | const URL & | url, |
| std::shared_ptr< Job > | onConnJob ) |
Set the on-connect handler for data streams.
Definition at line 423 of file XrdClPostMaster.cc.
| bool XrdCl::PostMaster::Start | ( | ) |
Start the post master.
Definition at line 194 of file XrdClPostMaster.cc.
Referenced by XrdCl::DefaultEnv::GetPostMaster().
| bool XrdCl::PostMaster::Stop | ( | ) |
Stop the postmaster.
Definition at line 222 of file XrdClPostMaster.cc.
Referenced by main().