ROOT  6.06/09
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 #ifndef ROOT_TSysEvtHandler
26 #include "TSysEvtHandler.h"
27 #endif
28 #ifndef ROOT_TXSocket
29 #include "TXSocket.h"
30 #endif
31 
32 class TXSocketHandler : public TFileHandler {
33 
34 // friend class TXSocket;
35 
36  TFileHandler *fHandler; // Handler associated to the input socket
37  TSocket *fInputSock; // Input socket from client or master
38 
40  { fHandler = h; fInputSock = s; }
41 
42  static TXSocketHandler *fgSocketHandler; // Input socket handler
43 
45  TFileHandler(TXSocket::fgPipe.GetRead(), 1)
46  { fHandler = h; fInputSock = s; }
47 public:
48  virtual ~TXSocketHandler() { }
49 
50  Bool_t Notify();
51  Bool_t ReadNotify() { return Notify(); }
52 
54 
55  ClassDef(TXSocketHandler, 0) //Input handler class for xproofd sockets
56 };
57 
58 #endif
Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
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'...
TH1 * h
Definition: legend2.C:5
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:254
void SetHandler(TFileHandler *h, TSocket *s)
TFileHandler * fHandler
Bool_t Notify()
Notify when event occurred on descriptor associated with this handler.
virtual ~TXSocketHandler()
static TXSocketHandler * fgSocketHandler
TSocket * fInputSock
TXSocketHandler(TFileHandler *h, TSocket *s)