Logo ROOT   6.08/07
Reference Guide
TXUnixSocket.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_TXUnixSocket
13 #define ROOT_TXUnixSocket
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TXUnixSocket //
18 // //
19 // Implementation of TXSocket using PF_UNIX sockets. //
20 // Used for the internal connection between coordinator and proofserv. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TXSocket
25 #include "TXSocket.h"
26 #endif
27 #include <list>
28 
29 class TXHandler;
30 
31 class TXUnixSocket : public TXSocket {
32 
33 friend class TXProofServ;
34 
35 private:
36  std::list<Int_t> fClientIDs;
37 
38 public:
39  TXUnixSocket(const char *u, Int_t psid = -1, Char_t ver = -1,
40  TXHandler *handler = 0, int fd = -1);
41  virtual ~TXUnixSocket() { fSessionID = -1; }
42 
43  Int_t GetClientID() const { return (fClientIDs.size() > 0) ? fClientIDs.front() : -1; }
44  Int_t GetClientIDSize() const { return fClientIDs.size(); }
45 
46  void RemoveClientID() { if (fClientIDs.size() > 1) fClientIDs.pop_front(); }
47  void SetClientID(Int_t cid) { fClientIDs.push_front(cid); }
48 
49  // Try reconnection after error
50  Int_t Reconnect();
51 
52  ClassDef(TXUnixSocket, 0) //Connection class for Xrd PROOF using UNIX sockets
53 };
54 
55 #endif
void SetClientID(Int_t cid)
Definition: TXUnixSocket.h:47
int Int_t
Definition: RtypesCore.h:41
std::list< Int_t > fClientIDs
Definition: TXUnixSocket.h:36
Implementation of TXSocket using PF_UNIX sockets.
Definition: TXUnixSocket.h:31
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t GetClientIDSize() const
Definition: TXUnixSocket.h:44
This class implements the XProofD version of TProofServ, with respect to which it differs only for th...
Definition: TXProofServ.h:34
Handler of asynchronous events for XProofD sockets.
Definition: TXHandler.h:30
High level handler of connections to XProofD.
Definition: TXSocket.h:73
Short_t fSessionID
Definition: TXSocket.h:85
char Char_t
Definition: RtypesCore.h:29
void RemoveClientID()
Definition: TXUnixSocket.h:46
virtual ~TXUnixSocket()
Definition: TXUnixSocket.h:41
Int_t Reconnect()
Try reconnection after failure.
Int_t GetClientID() const
Definition: TXUnixSocket.h:43
TXUnixSocket(const char *u, Int_t psid=-1, Char_t ver=-1, TXHandler *handler=0, int fd=-1)
Constructor.