forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TXUnixSocket.h
53 lines (39 loc) · 1.98 KB
/
TXUnixSocket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// @(#)root/proofx:$Id$
// Author: G. Ganis Oct 2005
/*************************************************************************
* Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TXUnixSocket
#define ROOT_TXUnixSocket
//////////////////////////////////////////////////////////////////////////
// //
// TXUnixSocket //
// //
// Implementation of TXSocket using PF_UNIX sockets. //
// Used for the internal connection between coordinator and proofserv. //
// //
//////////////////////////////////////////////////////////////////////////
#include "TXSocket.h"
#include <list>
class TXHandler;
class TXUnixSocket : public TXSocket {
friend class TXProofServ;
private:
std::list<Int_t> fClientIDs;
public:
TXUnixSocket(const char *u, Int_t psid = -1, Char_t ver = -1,
TXHandler *handler = 0, int fd = -1);
virtual ~TXUnixSocket() { fSessionID = -1; }
Int_t GetClientID() const { return (fClientIDs.size() > 0) ? fClientIDs.front() : -1; }
Int_t GetClientIDSize() const { return fClientIDs.size(); }
void RemoveClientID() { if (fClientIDs.size() > 1) fClientIDs.pop_front(); }
void SetClientID(Int_t cid) { fClientIDs.push_front(cid); }
// Try reconnection after error
Int_t Reconnect();
ClassDef(TXUnixSocket, 0) //Connection class for Xrd PROOF using UNIX sockets
};
#endif