ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
XrdProofPhyConn.h
Go to the documentation of this file.
1 // @(#)root/proofd:$Id$
2 // Author: G. Ganis June 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_XrdProofPhyConn
13 #define ROOT_XrdProofPhyConn
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // XrdProofPhyConn //
19 // //
20 // Authors: G. Ganis, CERN, 2005 //
21 // //
22 // XrdProofConn implementation using a simple phycical connection //
23 // (Unix or Tcp) //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_XrdProofConn
27 #include "XrdProofConn.h"
28 #endif
29 
30 class XrdProofPhyConn : public XrdProofConn {
31 
32 friend class TXSocket;
33 friend class TXUnixSocket;
34 
35 private:
36 
37  bool fTcp; // TRUE for TCP sockets
38 
39  void Connect(int fd = -1);
40  int TryConnect(int fd = -1);
42  bool Init(const char *url, int fd = -1);
43 
44 public:
45  XrdProofPhyConn(const char *url, int psid = -1, char ver = -1,
46  XrdClientAbsUnsolMsgHandler *uh = 0, bool tcp = 0, int fd = -1);
47  virtual ~XrdProofPhyConn() { Close(); }
48 
49  void Close(const char *opt = "");
50 
51  // Send, Recv interfaces
52  int ReadRaw(void *buf, int len, XrdClientPhyConnection * = 0);
54  void SetAsync(XrdClientAbsUnsolMsgHandler *uh, XrdProofConnSender_t = 0, void * = 0);
55  int WriteRaw(const void *buf, int len, XrdClientPhyConnection * = 0);
56 };
57 
58 #endif
int WriteRaw(const void *buf, int len, XrdClientPhyConnection *=0)
Low level write call.
void Close(const char *opt="")
Close the connection.
void SetAsync(XrdClientAbsUnsolMsgHandler *uh, XrdProofConnSender_t=0, void *=0)
Set handler of unsolicited responses.
Implementation of TXSocket using PF_UNIX sockets.
Definition: TXUnixSocket.h:31
bool Init(const char *url, int fd=-1)
Initialization.
bool GetAccessToSrv(XrdClientPhyConnection *=0)
Gets access to the connected server.
virtual ~XrdProofPhyConn()
int(* XrdProofConnSender_t)(const char *, int, void *)
Definition: XrdProofConn.h:56
High level handler of connections to XProofD.
Definition: TXSocket.h:72
XrdClientMessage * ReadMsg()
Pickup message from the queue.
void Connect(int fd=-1)
Run the connection attempts: the result is stored in fConnected.
int TryConnect(int fd=-1)
Connect to remote server.
int ReadRaw(void *buf, int len, XrdClientPhyConnection *=0)
Low level write call.
XrdProofPhyConn(const char *url, int psid=-1, char ver=-1, XrdClientAbsUnsolMsgHandler *uh=0, bool tcp=0, int fd=-1)
Constructor.