xrootd
XrdClChannel.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef __XRD_CL_POST_CHANNEL_HH__
20 #define __XRD_CL_POST_CHANNEL_HH__
21 
22 #include <stdint.h>
23 #include <vector>
24 #include <ctime>
25 #include <functional>
26 
27 #include "XrdCl/XrdClStatus.hh"
28 #include "XrdCl/XrdClURL.hh"
29 #include "XrdCl/XrdClPoller.hh"
30 #include "XrdCl/XrdClInQueue.hh"
32 #include "XrdCl/XrdClAnyObject.hh"
34 
35 #include "XrdSys/XrdSysPthread.hh"
36 
37 namespace XrdCl
38 {
39  class Stream;
40  class JobManager;
41  class VirtualRedirector;
42  class TickGeneratorTask;
43  class Job;
44 
45  //----------------------------------------------------------------------------
47  //----------------------------------------------------------------------------
48  class Channel
49  {
50  public:
51  //------------------------------------------------------------------------
59  //------------------------------------------------------------------------
60  Channel( const URL &url,
61  Poller *poller,
62  TransportHandler *transport,
63  TaskManager *taskManager,
64  JobManager *jobManager );
65 
66  //------------------------------------------------------------------------
68  //------------------------------------------------------------------------
70 
71  //------------------------------------------------------------------------
73  //------------------------------------------------------------------------
74  const URL &GetURL() const
75  {
76  return pUrl;
77  }
78 
79  //------------------------------------------------------------------------
89  //------------------------------------------------------------------------
90  XRootDStatus Send( Message *msg, bool stateful, time_t expires );
91 
92  //------------------------------------------------------------------------
105  //------------------------------------------------------------------------
107  OutgoingMsgHandler *handler,
108  bool stateful,
109  time_t expires );
110 
111  //------------------------------------------------------------------------
121  //------------------------------------------------------------------------
122  Status Receive( Message *&msg, MessageFilter *filter, time_t expires );
123 
124  //------------------------------------------------------------------------
131  //------------------------------------------------------------------------
132  Status Receive( IncomingMsgHandler *handler, time_t expires );
133 
134  //------------------------------------------------------------------------
141  //------------------------------------------------------------------------
142  Status QueryTransport( uint16_t query, AnyObject &result );
143 
144  //------------------------------------------------------------------------
146  //------------------------------------------------------------------------
148 
149  //------------------------------------------------------------------------
151  //------------------------------------------------------------------------
153 
154  //------------------------------------------------------------------------
156  //------------------------------------------------------------------------
157  void Tick( time_t now );
158 
159  //------------------------------------------------------------------------
161  //------------------------------------------------------------------------
163 
164  //------------------------------------------------------------------------
166  //------------------------------------------------------------------------
167  uint16_t NbConnectedStrm();
168 
169  //------------------------------------------------------------------------
171  //------------------------------------------------------------------------
172  void SetOnDataConnectHandler( std::shared_ptr<Job> &onConnJob );
173 
174  private:
175 
184  TickGeneratorTask *pTickGenerator;
186  };
187 }
188 
189 #endif // __XRD_CL_POST_CHANNEL_HH__
XrdCl::Channel::ForceDisconnect
Status ForceDisconnect()
Force disconnect of all streams.
XrdClTaskManager.hh
XrdCl::OutgoingMsgHandler
Message status handler.
Definition: XrdClPostMasterInterfaces.hh:169
XrdClPostMasterInterfaces.hh
XrdSysMutex
Definition: XrdSysPthread.hh:166
XrdCl::Channel::Receive
Status Receive(Message *&msg, MessageFilter *filter, time_t expires)
XrdSysPthread.hh
XrdCl::Channel::Receive
Status Receive(IncomingMsgHandler *handler, time_t expires)
XrdCl::Poller
Interface for socket pollers.
Definition: XrdClPoller.hh:87
XrdCl::Channel::GetURL
const URL & GetURL() const
Get the URL.
Definition: XrdClChannel.hh:74
XrdCl::JobManager
A synchronized queue.
Definition: XrdClJobManager.hh:51
XrdCl::Channel::pTickGenerator
TickGeneratorTask * pTickGenerator
Definition: XrdClChannel.hh:184
XrdCl::Message
The message representation used throughout the system.
Definition: XrdClMessage.hh:30
XrdCl::Channel::QueryTransport
Status QueryTransport(uint16_t query, AnyObject &result)
XrdCl::XRootDStatus
Request status.
Definition: XrdClXRootDResponses.hh:215
XrdCl::Channel::pTransport
TransportHandler * pTransport
Definition: XrdClChannel.hh:178
XrdCl::Channel::Channel
Channel(const URL &url, Poller *poller, TransportHandler *transport, TaskManager *taskManager, JobManager *jobManager)
XrdCl::Channel::pMutex
XrdSysMutex pMutex
Definition: XrdClChannel.hh:181
XrdCl::Channel::Send
XRootDStatus Send(Message *msg, bool stateful, time_t expires)
XrdCl::Channel::Tick
void Tick(time_t now)
Handle a time event.
XrdCl::TaskManager
Definition: XrdClTaskManager.hh:76
XrdCl::InQueue
A synchronize queue for incoming data.
Definition: XrdClInQueue.hh:36
XrdCl::MessageFilter
Message filter.
Definition: XrdClPostMasterInterfaces.hh:50
XrdCl::Channel::pJobManager
JobManager * pJobManager
Definition: XrdClChannel.hh:185
XrdCl::IncomingMsgHandler
Message handler.
Definition: XrdClPostMasterInterfaces.hh:72
XrdCl::Channel::RegisterEventHandler
void RegisterEventHandler(ChannelEventHandler *handler)
Register channel event handler.
XrdCl::Channel::pUrl
URL pUrl
Definition: XrdClChannel.hh:176
XrdCl::Channel
A communication channel between the client and the server.
Definition: XrdClChannel.hh:49
XrdCl::Channel::pIncoming
InQueue pIncoming
Definition: XrdClChannel.hh:183
XrdClPoller.hh
XrdCl::Channel::NbConnectedStrm
uint16_t NbConnectedStrm()
Get the number of connected data streams.
XrdCl::Channel::Send
XRootDStatus Send(Message *msg, OutgoingMsgHandler *handler, bool stateful, time_t expires)
XrdCl
Definition: XrdClAnyObject.hh:26
XrdCl::Channel::RemoveEventHandler
void RemoveEventHandler(ChannelEventHandler *handler)
Remove a channel event handler.
XrdClInQueue.hh
XrdClStatus.hh
XrdClAnyObject.hh
XrdCl::Channel::~Channel
~Channel()
Destructor.
XrdClURL.hh
XrdCl::Channel::SetOnDataConnectHandler
void SetOnDataConnectHandler(std::shared_ptr< Job > &onConnJob)
Set the on-connect handler for data streams.
XrdCl::Channel::pChannelData
AnyObject pChannelData
Definition: XrdClChannel.hh:182
XrdCl::Channel::pStream
Stream * pStream
Definition: XrdClChannel.hh:180
XrdCl::Status
Procedure execution status.
Definition: XrdClStatus.hh:111
XrdCl::URL
URL representation.
Definition: XrdClURL.hh:31
XrdCl::Channel::pTaskManager
TaskManager * pTaskManager
Definition: XrdClChannel.hh:179
XrdCl::ChannelEventHandler
Channel event handler.
Definition: XrdClPostMasterInterfaces.hh:221
XrdCl::TransportHandler
Perform the handshake and the authentication for each physical stream.
Definition: XrdClPostMasterInterfaces.hh:301
XrdCl::AnyObject
Definition: XrdClAnyObject.hh:33
XrdCl::Stream
Stream.
Definition: XrdClStream.hh:49
XrdCl::Channel::pPoller
Poller * pPoller
Definition: XrdClChannel.hh:177