Logo ROOT   6.10/09
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 #include "TXSocket.h"
25 #include <list>
26 
27 class TXHandler;
28 
29 class TXUnixSocket : public TXSocket {
30 
31 friend class TXProofServ;
32 
33 private:
34  std::list<Int_t> fClientIDs;
35 
36 public:
37  TXUnixSocket(const char *u, Int_t psid = -1, Char_t ver = -1,
38  TXHandler *handler = 0, int fd = -1);
39  virtual ~TXUnixSocket() { fSessionID = -1; }
40 
41  Int_t GetClientID() const { return (fClientIDs.size() > 0) ? fClientIDs.front() : -1; }
42  Int_t GetClientIDSize() const { return fClientIDs.size(); }
43 
44  void RemoveClientID() { if (fClientIDs.size() > 1) fClientIDs.pop_front(); }
45  void SetClientID(Int_t cid) { fClientIDs.push_front(cid); }
46 
47  // Try reconnection after error
48  Int_t Reconnect();
49 
50  ClassDef(TXUnixSocket, 0) //Connection class for Xrd PROOF using UNIX sockets
51 };
52 
53 #endif
void SetClientID(Int_t cid)
Definition: TXUnixSocket.h:45
int Int_t
Definition: RtypesCore.h:41
std::list< Int_t > fClientIDs
Definition: TXUnixSocket.h:34
Implementation of TXSocket using PF_UNIX sockets.
Definition: TXUnixSocket.h:29
#define ClassDef(name, id)
Definition: Rtypes.h:297
Int_t GetClientIDSize() const
Definition: TXUnixSocket.h:42
This class implements the XProofD version of TProofServ, with respect to which it differs only for th...
Definition: TXProofServ.h:30
Handler of asynchronous events for XProofD sockets.
Definition: TXHandler.h:28
High level handler of connections to XProofD.
Definition: TXSocket.h:59
Short_t fSessionID
Definition: TXSocket.h:71
char Char_t
Definition: RtypesCore.h:29
void RemoveClientID()
Definition: TXUnixSocket.h:44
virtual ~TXUnixSocket()
Definition: TXUnixSocket.h:39
Int_t Reconnect()
Try reconnection after failure.
Int_t GetClientID() const
Definition: TXUnixSocket.h:41
TXUnixSocket(const char *u, Int_t psid=-1, Char_t ver=-1, TXHandler *handler=0, int fd=-1)
Constructor.