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 );
113 pStream =
new Stream( &pUrl, prefurl );
126 pTaskManager->
RegisterTask( pTickGenerator, ::time(0)+timeoutResolution );
148 return pStream->
Send( msg, handler, stateful, expires );
156 pStream->
Tick( now );
227 return pTransport->
Query( query, result, pChannelData );
228 return pStream->
Query( query, result );
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.
XRootDStatus Send(Message *msg, MsgHandler *handler, bool stateful, time_t expires)
Queue the message for sending.
void SetTransport(TransportHandler *transport)
Set the transport.
void SetIncomingQueue(InQueue *incomingQueue)
Set the incoming queue.
bool CanCollapse(const URL &url)
void SetPoller(Poller *poller)
Set the poller.
void ForceConnect()
Force connection.
void ForceError(XRootDStatus status, bool hush=false)
Force error.
void SetTaskManager(TaskManager *taskManager)
Set task manager.
void SetOnDataConnectHandler(std::shared_ptr< Job > &onConnJob)
Set the on-connect handler for data streams.
void SetJobManager(JobManager *jobManager)
Set job manager.
Status Query(uint16_t query, AnyObject &result)
Query the stream.
void RemoveEventHandler(ChannelEventHandler *handler)
Remove a channel event handler.
void SetChannelData(AnyObject *channelData)
Set the channel data.
XRootDStatus Initialize()
Initializer.
void RegisterEventHandler(ChannelEventHandler *handler)
Register channel event handler.
void RegisterTask(Task *task, time_t time, bool own=true)
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.
virtual Status Query(uint16_t query, AnyObject &result, AnyObject &channelData)=0
Query the channel.
virtual void FinalizeChannel(AnyObject &channelData)=0
Finalize channel.
virtual void InitializeChannel(const URL &url, AnyObject &channelData)=0
Initialize channel.
virtual void DecFileInstCnt(AnyObject &channelData)=0
Decrement file object instance count bound to this channel.
std::string GetChannelId() const
const std::string & GetProtocol() const
Get the protocol.
void SetParams(const std::string ¶ms)
Set params.
const ParamsMap & GetParams() const
Get the URL params.
void SetProtocol(const std::string &protocol)
Set 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.