48 std::string name =
"TickGeneratorTask for: ";
56 time_t
Run( time_t now )
59 if( !pChannel )
return 0;
61 using namespace XrdCl;
62 pChannel->Tick( now );
66 env->
GetInt(
"TimeoutResolution", timeoutResolution );
67 return now+timeoutResolution;
90 pUrl( url.GetHostId() ),
92 pTransport( transport ),
93 pTaskManager( taskManager ),
95 pJobManager( jobManager )
101 env->
GetInt(
"TimeoutResolution", timeoutResolution );
103 pTransport->InitializeChannel( url, pChannelData );
113 pStream =
new Stream( &pUrl, prefurl );
114 pStream->SetTransport( transport );
115 pStream->SetPoller( poller );
116 pStream->SetIncomingQueue( &pIncoming );
117 pStream->SetTaskManager( taskManager );
118 pStream->SetJobManager( jobManager );
119 pStream->SetChannelData( &pChannelData );
120 pStream->Initialize();
126 pTaskManager->RegisterTask( pTickGenerator, ::time(0)+timeoutResolution );
134 pTickGenerator->Invalidate();
136 pTransport->FinalizeChannel( pChannelData );
148 return pStream->Send( msg, handler, stateful, expires );
156 pStream->Tick( now );
185 pStream->ForceConnect();
202 pStream->SetOnDataConnectHandler( onConnJob );
210 return pStream->CanCollapse( url );
218 pTransport->DecFileInstCnt( pChannelData );
227 return pTransport->Query( query, result, pChannelData );
228 return pStream->Query( query, result );
236 pStream->RegisterEventHandler( handler );
244 pStream->RemoveEventHandler( handler );
A communication channel between the client and the server.
uint16_t NbConnectedStrm()
Get the number of connected data streams.
Status ForceReconnect()
Force reconnect.
void RemoveEventHandler(ChannelEventHandler *handler)
Remove a channel event handler.
void SetOnDataConnectHandler(std::shared_ptr< Job > &onConnJob)
Set the on-connect handler for data streams.
void RegisterEventHandler(ChannelEventHandler *handler)
Register channel event handler.
void DecFileInstCnt()
Decrement file object instance count bound to this channel.
Status ForceDisconnect()
Force disconnect of all streams.
XRootDStatus Send(Message *msg, MsgHandler *handler, bool stateful, time_t expires)
void Tick(time_t now)
Handle a time event.
bool CanCollapse(const URL &url)
Status QueryTransport(uint16_t query, AnyObject &result)
Channel(const URL &url, Poller *poller, TransportHandler *transport, TaskManager *taskManager, JobManager *jobManager, const URL &prefurl=URL())
static Log * GetLog()
Get default log.
static Env * GetEnv()
Get default client environment.
bool GetInt(const std::string &key, int &value)
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
The message representation used throughout the system.
Interface for socket pollers.
Interface for a task to be run by the TaskManager.
void SetName(const std::string &name)
Set name of the task.
TickGeneratorTask(XrdCl::Channel *channel, const std::string &hostId)
Perform the handshake and the authentication for each physical stream.
std::string GetChannelId() const
const ParamsMap & GetParams() const
Get the URL params.
const std::string & GetProtocol() const
Get the protocol.
static uint16_t NbConnectedStrm(AnyObject &channelData)
Number of currently connected data streams.
const uint16_t stError
An error occurred that could potentially be retried.
const uint64_t PostMasterMsg
const int DefaultTimeoutResolution
const uint16_t errOperationInterrupted
Procedure execution status.