49 TSocket *GetSocket()
const {
return fSocket; }
64 Bool_t TSocketHandler::Notify()
67 fMonitor->SetReady(fSocket);
76 class TTimeOutTimer :
public TTimer {
93 Bool_t TTimeOutTimer::Notify()
96 fMonitor->SetReady((
TSocket *)-1);
131 if (sh->HasReadInterest()) mask |= 0
x1;
132 if (sh->HasWriteInterest()) mask |= 0
x2;
140 if (sh->HasReadInterest()) mask |= 0
x1;
141 if (sh->HasWriteInterest()) mask |= 0
x2;
190 if (sock == s->GetSocket()) {
191 s->SetInterest(interest);
199 if (sock == s->GetSocket()) {
202 s->SetInterest(interest);
220 if (sock == s->GetSocket()) {
230 if (sock == s->GetSocket()) {
256 if (sock == s->GetSocket()) {
290 if (sock == s->GetSocket()) {
333 Info(
"Select",
"*** interrupt occured ***");
364 Info(
"Select",
"*** interrupt occured ***");
391 if (nr > 0 && (rdready || wrready)) {
401 if (rdready && h->IsReadReady())
402 rdready->
Add(h->GetSocket());
403 if (wrready && h->IsWriteReady())
404 wrready->
Add(h->GetSocket());
407 if (rdready && h->IsReadReady())
408 rdready->
Add(h->GetSocket());
409 if (wrready && h->IsWriteReady())
410 wrready->
Add(h->GetSocket());
451 Info(
"GetActive",
"socket: %p: %s:%d did not show any activity" 452 " during the last %ld millisecs: deactivating",
460 }
else if (timeout == 0) {
463 s->GetSocket()->Touch();
486 if (sock ==
h->GetSocket())
505 list->
Add(
h->GetSocket());
522 list->
Add(
h->GetSocket());
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual Bool_t Notify()
Notify when event occurred on descriptor associated with this handler.
virtual void Remove(TSocket *sock)
Remove a socket from the monitor.
Int_t GetActive(Long_t timeout=-1) const
Return number of sockets in the active list.
Int_t GetDeActive() const
Return number of sockets in the de-active list.
const char * GetHostName() const
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
virtual void Add(TSocket *sock, Int_t interest=kRead)
Add socket to the monitor's active list.
Bool_t IsActive(TSocket *s) const
Check if socket 's' is in the active list.
virtual void RemoveAll()
Remove all sockets from the monitor.
virtual ~TMonitor()
Cleanup the monitor object. Does not delete sockets being monitored.
virtual void DeActivateAll()
De-activate all activated sockets.
TTimeStamp GetLastUsage()
static const double x2[5]
virtual void DeActivate(TSocket *sock)
De-activate a socket.
virtual Bool_t Notify()
This method must be overridden to handle object notification.
friend class TTimeOutTimer
TSocket * Select()
Return pointer to socket for which an event is waiting.
virtual void SetInterest(TSocket *sock, Int_t interest=kRead)
Set interest mask for socket sock to interest.
virtual Bool_t WriteNotify()
Notify when something can be written to the descriptor associated with this handler.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
R__EXTERN TSystem * gSystem
virtual TObject * Remove(TObject *obj)
Remove object from the list.
void SetReady(TSocket *sock)
Called by TSocketHandler::Notify() to signal which socket is ready to be read or written.
TList * GetListOfActives() const
Returns a list with all active sockets.
Handles synchronous and a-synchronous timer events.
virtual void InnerLoop()
Inner event loop.
virtual void Activate(TSocket *sock)
Activate a de-activated socket.
static constexpr double ms
virtual Int_t Select(TList *active, Long_t timeout)
Select on active file descriptors (called by TMonitor).
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
static const double x1[5]
TList * GetListOfDeActives() const
Returns a list with all de-active sockets.
The TTimeStamp encapsulates seconds and ns since EPOCH.
static constexpr double s
virtual void Ready(TSocket *sock)
Emit signal when some socket is ready.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
friend class TSocketHandler
TMonitor(Bool_t mainloop=kTRUE)
Create a monitor object.
virtual void Add(TObject *obj)
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
TInetAddress GetInetAddress() const
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
virtual void ActivateAll()
Activate all de-activated sockets.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static constexpr double ns