|
XRootD
|
#include <XrdClStream.hh>
Collaboration diagram for XrdCl::Stream:Public Types | |
| enum | StreamStatus { Disconnected = 0 , Connected = 1 , Connecting = 2 , Error = 3 } |
| Status of the stream. More... | |
Public Member Functions | |
| Stream (const URL *url, const URL &prefer=URL()) | |
| Constructor. | |
| ~Stream () | |
| Destructor. | |
| bool | CanCollapse (const URL &url) |
| void | DisableIfEmpty (uint16_t subStream) |
| Disables respective uplink if empty. | |
| void | Disconnect (bool force=false) |
| Disconnect the stream. | |
| XRootDStatus | EnableLink (PathID &path) |
| void | ForceConnect () |
| Force connection. | |
| void | ForceError (XRootDStatus status, bool hush=false) |
| Force error. | |
| const std::string & | GetName () const |
| Return stream name. | |
| const URL * | GetURL () const |
| Get the URL. | |
| XRootDStatus | Initialize () |
| Initializer. | |
| uint16_t | InspectStatusRsp (uint16_t stream, MsgHandler *&incHandler) |
| MsgHandler * | InstallIncHandler (std::shared_ptr< Message > &msg, uint16_t stream) |
| void | OnConnect (uint16_t subStream) |
| Call back when a message has been reconstructed. | |
| void | OnConnectError (uint16_t subStream, XRootDStatus status) |
| On connect error. | |
| void | OnError (uint16_t subStream, XRootDStatus status) |
| On error. | |
| void | OnIncoming (uint16_t subStream, std::shared_ptr< Message > msg, uint32_t bytesReceived) |
| Call back when a message has been reconstructed. | |
| void | OnMessageSent (uint16_t subStream, Message *msg, uint32_t bytesSent) |
| bool | OnReadTimeout (uint16_t subStream) XRD_WARN_UNUSED_RESULT |
| On read timeout. | |
| std::pair< Message *, MsgHandler * > | OnReadyToWrite (uint16_t subStream) |
| bool | OnWriteTimeout (uint16_t subStream) XRD_WARN_UNUSED_RESULT |
| On write timeout. | |
| Status | Query (uint16_t query, AnyObject &result) |
| Query the stream. | |
| 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) |
| Queue the message for sending. | |
| void | SetChannelData (AnyObject *channelData) |
| Set the channel data. | |
| void | SetIncomingQueue (InQueue *incomingQueue) |
| Set the incoming queue. | |
| void | SetJobManager (JobManager *jobManager) |
| Set job manager. | |
| void | SetOnDataConnectHandler (std::shared_ptr< Job > &onConnJob) |
| Set the on-connect handler for data streams. | |
| void | SetPoller (Poller *poller) |
| Set the poller. | |
| void | SetTaskManager (TaskManager *taskManager) |
| Set task manager. | |
| void | SetTransport (TransportHandler *transport) |
| Set the transport. | |
| void | Tick (time_t now) |
Definition at line 51 of file XrdClStream.hh.
Status of the stream.
| Enumerator | |
|---|---|
| Disconnected | Not connected. |
| Connected | Connected. |
| Connecting | In the process of being connected. |
| Error | Broken. |
Definition at line 57 of file XrdClStream.hh.
Constructor.
Definition at line 96 of file XrdClStream.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultConnectionRetry, XrdCl::DefaultConnectionWindow, XrdCl::DefaultNetworkStack, XrdCl::DefaultStreamErrorWindow, XrdCl::Utils::GetIntParameter(), XrdCl::DefaultEnv::GetLog(), XrdCl::Utils::GetStringParameter(), XrdNetUtils::hasIP64, XrdNetUtils::hasIPv4, XrdNetUtils::hasIPv6, XrdCl::Utils::IPAuto, XrdCl::Utils::IPv4, XrdCl::Utils::IPv6, XrdNetUtils::NetConfig(), XrdCl::PostMasterMsg, XrdNetUtils::qryINIF, and XrdCl::Utils::String2AddressType().
Here is the call graph for this function:| XrdCl::Stream::~Stream | ( | ) |
Destructor.
Definition at line 153 of file XrdClStream.cc.
References XrdCl::Log::Debug(), Disconnect(), XrdCl::DefaultEnv::GetLog(), and XrdCl::PostMasterMsg.
Here is the call graph for this function:| bool XrdCl::Stream::CanCollapse | ( | const URL & | url | ) |
Definition at line 1159 of file XrdClStream.cc.
References XrdCl::Log::Error(), XrdCl::Utils::GetHostAddresses(), XrdCl::URL::GetHostName(), XrdCl::DefaultEnv::GetLog(), XrdCl::Status::IsOK(), and XrdCl::PostMasterMsg.
Here is the call graph for this function:| void XrdCl::Stream::DisableIfEmpty | ( | uint16_t | subStream | ) |
Disables respective uplink if empty.
Definition at line 585 of file XrdClStream.cc.
References XrdCl::Log::Dump(), XrdCl::DefaultEnv::GetLog(), and XrdCl::PostMasterMsg.
Here is the call graph for this function:| void XrdCl::Stream::Disconnect | ( | bool | force = false | ) |
Disconnect the stream.
Definition at line 363 of file XrdClStream.cc.
References XrdCl::Socket::Disconnected.
Referenced by ~Stream().
Here is the caller graph for this function:| XRootDStatus XrdCl::Stream::EnableLink | ( | PathID & | path | ) |
Connect if needed, otherwise make sure that the underlying socket handler gets write readiness events, it will update the path with what it has actually enabled
Definition at line 187 of file XrdClStream.cc.
References XrdCl::Socket::Connected, XrdCl::Socket::Connecting, XrdCl::Socket::Disconnected, XrdCl::PathID::down, XrdCl::Log::Error(), XrdCl::Utils::GetHostAddresses(), XrdCl::DefaultEnv::GetLog(), XrdCl::Status::IsOK(), XrdCl::Utils::LogHostAddresses(), XrdCl::PostMasterMsg, XrdCl::Status::status, XrdCl::stFatal, and XrdCl::PathID::up.
Referenced by ForceConnect(), OnConnectError(), OnError(), and Send().
Here is the call graph for this function:
Here is the caller graph for this function:| void XrdCl::Stream::ForceConnect | ( | ) |
Force connection.
Definition at line 347 of file XrdClStream.cc.
References XrdCl::Socket::Connecting, XrdCl::Socket::Disconnected, EnableLink(), XrdCl::Status::IsOK(), and OnConnectError().
Here is the call graph for this function:| void XrdCl::Stream::ForceError | ( | XRootDStatus | status, |
| bool | hush = false ) |
Force error.
Definition at line 914 of file XrdClStream.cc.
References XrdCl::MsgHandler::Broken, XrdCl::Socket::Connected, XrdCl::Log::Debug(), XrdCl::Socket::Disconnected, XrdCl::DefaultEnv::GetLog(), XrdCl::OutQueue::GrabItems(), XrdCl::PostMasterMsg, XrdCl::OutQueue::Report(), XrdCl::ChannelEventHandler::StreamBroken, XrdCl::Status::ToString(), and XrdSysMutexHelper::UnLock().
Here is the call graph for this function:
|
inline |
Return stream name.
Definition at line 170 of file XrdClStream.hh.
|
inline |
| XRootDStatus XrdCl::Stream::Initialize | ( | ) |
Initializer.
Definition at line 171 of file XrdClStream.cc.
References XrdCl::errUninitialized, and XrdCl::stError.
| uint16_t XrdCl::Stream::InspectStatusRsp | ( | uint16_t | stream, |
| MsgHandler *& | incHandler ) |
In case the message is a kXR_status response it needs further attention
Definition at line 1128 of file XrdClStream.cc.
References XrdCl::InMessageHelper::action, XrdCl::MsgHandler::Corrupted, XrdCl::InMessageHelper::handler, XrdCl::MsgHandler::InspectStatusRsp(), XrdCl::MsgHandler::More, XrdCl::MsgHandler::None, XrdCl::MsgHandler::Raw, and XrdCl::MsgHandler::RemoveHandler.
Here is the call graph for this function:| MsgHandler * XrdCl::Stream::InstallIncHandler | ( | std::shared_ptr< Message > & | msg, |
| uint16_t | stream ) |
Install a message handler for the given message if there is one available, if the handler want's to be called in the raw mode it will be returned, the message ownership flag is returned in any case
| msg | message header |
| stream | stream concerned |
Definition at line 1107 of file XrdClStream.cc.
References XrdCl::InMessageHelper::action, XrdCl::InMessageHelper::expires, XrdCl::InMessageHelper::handler, and XrdCl::MsgHandler::Raw.
| void XrdCl::Stream::OnConnect | ( | uint16_t | subStream | ) |
Call back when a message has been reconstructed.
Definition at line 623 of file XrdClStream.cc.
References XrdCl::TransportQuery::Auth, XrdCl::Monitor::ConnectInfo::auth, XrdCl::Socket::Connected, XrdCl::Socket::Connecting, XrdCl::Log::Debug(), XrdCl::Monitor::ConnectInfo::eTOD, XrdCl::Monitor::EvConnect, XrdCl::Monitor::Event(), XrdCl::AnyObject::Get(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetMonitor(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::Status::IsOK(), XrdCl::PostMaster::NotifyConnectHandler(), XrdCl::PostMasterMsg, XrdCl::Monitor::ConnectInfo::server, XrdCl::Monitor::ConnectInfo::sTOD, and XrdCl::Monitor::ConnectInfo::streams.
Here is the call graph for this function:| void XrdCl::Stream::OnConnectError | ( | uint16_t | subStream, |
| XRootDStatus | status ) |
On connect error.
Definition at line 728 of file XrdClStream.cc.
References XrdCl::Socket::Connected, XrdCl::Socket::Connecting, XrdCl::Socket::Disconnected, EnableLink(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::Log::Info(), XrdCl::Status::IsFatal(), XrdCl::Status::IsOK(), XrdCl::PostMaster::NotifyConnErrHandler(), and XrdCl::PostMasterMsg.
Referenced by ForceConnect().
Here is the call graph for this function:
Here is the caller graph for this function:| void XrdCl::Stream::OnError | ( | uint16_t | subStream, |
| XRootDStatus | status ) |
On error.
Definition at line 828 of file XrdClStream.cc.
References XrdCl::MsgHandler::Broken, XrdCl::Socket::Connected, XrdCl::Log::Debug(), XrdCl::Socket::Disconnected, EnableLink(), XrdCl::DefaultEnv::GetLog(), XrdCl::OutQueue::GrabStateful(), XrdCl::Status::IsOK(), XrdCl::PostMasterMsg, XrdCl::OutQueue::Report(), XrdCl::ChannelEventHandler::StreamBroken, XrdCl::Status::ToString(), and XrdSysMutexHelper::UnLock().
Referenced by OnReadTimeout().
Here is the call graph for this function:
Here is the caller graph for this function:| void XrdCl::Stream::OnIncoming | ( | uint16_t | subStream, |
| std::shared_ptr< Message > | msg, | ||
| uint32_t | bytesReceived ) |
Call back when a message has been reconstructed.
Definition at line 471 of file XrdClStream.cc.
References XrdCl::InMessageHelper::action, XrdCl::TransportHandler::DigestMsg, XrdCl::Log::Dump(), XrdCl::DefaultEnv::GetLog(), XrdCl::InMessageHelper::handler, ServerResponse::hdr, XrdCl::MsgHandler::Ignore, XrdCl::MsgHandler::NoProcess, XrdCl::XRootDMsgHandler::PartialReceived(), XrdCl::PostMasterMsg, XrdCl::TransportHandler::RequestClose, XrdCl::InMessageHelper::Reset(), ServerResponseHeader::status, ServerResponseHeader::streamid, and XrdCl::Log::Warning().
Here is the call graph for this function:| void XrdCl::Stream::OnMessageSent | ( | uint16_t | subStream, |
| Message * | msg, | ||
| uint32_t | bytesSent ) |
Definition at line 601 of file XrdClStream.cc.
References XrdCl::OutQueue::MsgHelper::handler, XrdCl::MsgHandler::OnStatusReady(), and XrdCl::OutQueue::MsgHelper::Reset().
Here is the call graph for this function:| bool XrdCl::Stream::OnReadTimeout | ( | uint16_t | subStream | ) |
On read timeout.
Definition at line 1012 of file XrdClStream.cc.
References XrdCl::Log::Debug(), XrdCl::PostMaster::ForceDisconnect(), XrdCl::DefaultEnv::GetLog(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::Status::IsOK(), OnError(), XrdCl::PostMasterMsg, and XrdSysMutexHelper::UnLock().
Here is the call graph for this function:| std::pair< Message *, MsgHandler * > XrdCl::Stream::OnReadyToWrite | ( | uint16_t | subStream | ) |
Definition at line 545 of file XrdClStream.cc.
References XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::OutQueue::MsgHelper::expires, XrdCl::DefaultEnv::GetLog(), XrdCl::Message::GetObfuscatedDescription(), XrdCl::OutQueue::MsgHelper::handler, XrdCl::OutQueue::MsgHelper::msg, XrdCl::MsgHandler::OnReadyToSend(), XrdCl::PostMasterMsg, XrdCl::OutQueue::MsgHelper::stateful, XrdSysMutexHelper::UnLock(), and XrdCl::Log::Warning().
Here is the call graph for this function:| bool XrdCl::Stream::OnWriteTimeout | ( | uint16_t | subStream | ) |
Query the stream.
Definition at line 1204 of file XrdClStream.cc.
References XrdCl::errQueryNotSupported, XrdCl::StreamQuery::HostName, XrdCl::StreamQuery::IpAddr, XrdCl::StreamQuery::IpStack, XrdCl::AnyObject::Set(), and XrdCl::stError.
Here is the call graph for this function:| void XrdCl::Stream::RegisterEventHandler | ( | ChannelEventHandler * | handler | ) |
Register channel event handler.
Definition at line 1090 of file XrdClStream.cc.
| void XrdCl::Stream::RemoveEventHandler | ( | ChannelEventHandler * | handler | ) |
Remove a channel event handler.
Definition at line 1098 of file XrdClStream.cc.
| XRootDStatus XrdCl::Stream::Send | ( | Message * | msg, |
| MsgHandler * | handler, | ||
| bool | stateful, | ||
| time_t | expires ) |
Queue the message for sending.
Definition at line 297 of file XrdClStream.cc.
References XrdCl::Socket::Connected, XrdCl::PathID::down, XrdCl::Log::Dump(), EnableLink(), XrdCl::errInvalidSession, XrdCl::DefaultEnv::GetLog(), XrdCl::Message::GetObfuscatedDescription(), XrdCl::Message::GetSessionId(), XrdCl::Status::IsOK(), XrdCl::PostMasterMsg, XrdCl::Status::status, XrdCl::stError, XrdCl::stFatal, XrdCl::PathID::up, and XrdCl::Log::Warning().
Here is the call graph for this function:
|
inline |
Set the channel data.
Definition at line 115 of file XrdClStream.hh.
|
inline |
Set the incoming queue.
Definition at line 107 of file XrdClStream.hh.
|
inline |
Set job manager.
Definition at line 131 of file XrdClStream.hh.
|
inline |
Set the on-connect handler for data streams.
Definition at line 263 of file XrdClStream.hh.
|
inline |
|
inline |
Set task manager.
Definition at line 123 of file XrdClStream.hh.
|
inline |
Set the transport.
Definition at line 91 of file XrdClStream.hh.
| void XrdCl::Stream::Tick | ( | time_t | now | ) |
Handle a clock event generated either by socket timeout, or by the task manager event
Definition at line 377 of file XrdClStream.cc.
References XrdCl::errOperationExpired, XrdCl::OutQueue::GrabExpired(), XrdCl::OutQueue::Report(), and XrdCl::stError.
Here is the call graph for this function: