Logo ROOT  
Reference Guide
TXSocketHandler.h
Go to the documentation of this file.
1 // @(#)root/proofx:$Id$
2 // Author: G. Ganis Oct 2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TXSocketHandler
13 #define ROOT_TXSocketHandler
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TXSocketHandler //
18 // //
19 // Input handler for xproofd sockets. These sockets cannot be directly //
20 // monitored on their descriptor, because the reading activity goes via //
21 // the reader thread. This class allows to handle this problem. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TSysEvtHandler.h"
26 #include "TXSocket.h"
27 
28 class TXSocketHandler : public TFileHandler {
29 
30 // friend class TXSocket;
31 
32  TFileHandler *fHandler; // Handler associated to the input socket
33  TSocket *fInputSock; // Input socket from client or master
34 
36  { fHandler = h; fInputSock = s; }
37 
38  static TXSocketHandler *fgSocketHandler; // Input socket handler
39 
41  TFileHandler(TXSocket::fgPipe.GetRead(), 1)
42  { fHandler = h; fInputSock = s; }
43 public:
44  virtual ~TXSocketHandler() { }
45 
47  Bool_t ReadNotify() { return Notify(); }
48 
50 
51  ClassDef(TXSocketHandler, 0) //Input handler class for xproofd sockets
52 };
53 
54 #endif
TXSocket
Definition: TXSocket.h:59
TXSocketHandler::fHandler
TFileHandler * fHandler
Definition: TXSocketHandler.h:38
TXSocketHandler::GetSocketHandler
static TXSocketHandler * GetSocketHandler(TFileHandler *h=0, TSocket *s=0)
Get an instance of the input socket handler with 'h' as handler, connected to socket 's'.
Definition: TXSocketHandler.cxx:66
TXSocketHandler::fInputSock
TSocket * fInputSock
Definition: TXSocketHandler.h:39
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TXSocketHandler::SetHandler
void SetHandler(TFileHandler *h, TSocket *s)
Definition: TXSocketHandler.h:41
TXSocketHandler::~TXSocketHandler
virtual ~TXSocketHandler()
Definition: TXSocketHandler.h:50
TXSocketHandler::TXSocketHandler
TXSocketHandler(TFileHandler *h, TSocket *s)
Definition: TXSocketHandler.h:46
bool
TSocket
Definition: TSocket.h:41
h
#define h(i)
Definition: RSha256.hxx:124
TXSocketHandler
Definition: TXSocketHandler.h:28
TXSocketHandler::Notify
Bool_t Notify()
Set readiness on the monitor.
Definition: TXSocketHandler.cxx:37
TXSocketHandler::ReadNotify
Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
Definition: TXSocketHandler.h:53
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TFileHandler
Definition: TSysEvtHandler.h:65
TXSocket.h
TXSocketHandler::fgSocketHandler
static TXSocketHandler * fgSocketHandler
Definition: TXSocketHandler.h:44
TSysEvtHandler.h