Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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