12 #ifndef ROOT_XrdProofConn
13 #define ROOT_XrdProofConn
25 #define DFLT_CONNECTMAXTRY 10
30 #include "XrdClient/XrdClientUnsolMsg.hh"
31 #include "XrdClient/XrdClientUrlInfo.hh"
32 #ifndef __OUC_STRING_H__
33 #include "XrdOuc/XrdOucString.hh"
38 class XrdClientConnectionMgr;
39 class XrdClientMessage;
40 class XrdClientPhyConnection;
104 bool CheckResp(
struct ServerResponseHeader *resp,
105 const char *met,
bool);
106 virtual void Connect(
int = -1);
112 virtual bool Init(
const char *url = 0,
int = -1);
116 const void *reqData,
char **answData);
124 XrdProofConn(
const char *url,
char mode =
'M',
int psid = -1,
char ver = -1,
125 XrdClientAbsUnsolMsgHandler * uh = 0,
const char *logbuf = 0);
128 virtual void Close(
const char *opt =
"");
135 const char *
GetUrl() {
return (
const char *)
fUrl.GetUrl().c_str(); }
143 virtual int ReadRaw(
void *buf,
int len, XrdClientPhyConnection *p = 0);
144 virtual XrdClientMessage *
ReadMsg();
146 char **answData,
const char *CmdName,
149 void SetSID(kXR_char *sid);
150 virtual int WriteRaw(
const void *buf,
int len, XrdClientPhyConnection *p = 0);
156 XrdClientMessage *
m);
virtual bool GetAccessToSrv(XrdClientPhyConnection *p=0)
Gets access to the connected server.
virtual ~XrdProofConn()
Destructor.
virtual XrdClientMessage * ReadMsg()
Pickup message from the queue.
virtual void Connect(int=-1)
Run the connection attempts: the result is stored in fConnected.
bool ConnectInterrupt()
Check if interrupted during connect.
static void SetRetryParam(int maxtry=5, int timewait=2)
Change values of the retry control parameters, numer of retries and wait time between attempts (in se...
XrdClientMessage * SendReq(XPClientRequest *req, const void *reqData, char **answData, const char *CmdName, bool notifyerr=1)
SendReq tries to send a single command for a number of times.
XrdOucString fLoginBuffer
void SetSID(kXR_char *sid)
Set our stream id, to match against that one in the server's response.
ESrvType DoHandShake(XrdClientPhyConnection *p=0)
Performs initial hand-shake with the server in order to understand which kind of server is there at t...
void SetInterrupt()
Interrupt the underlying socket.
Implementation of TXSocket using PF_UNIX sockets.
virtual int WriteRaw(const void *buf, int len, XrdClientPhyConnection *p=0)
Low level write call.
bool MatchStreamID(struct ServerResponseHeader *resp)
Check stream ID matching.
XrdClientMessage * SendRecv(XPClientRequest *req, const void *reqData, char **answData)
SendRecv sends a command to the server and to get a response.
XrdProofConn(const char *url, char mode= 'M', int psid=-1, char ver=-1, XrdClientAbsUnsolMsgHandler *uh=0, const char *logbuf=0)
Constructor.
static XrdClientConnectionMgr * fgConnMgr
const char * GetLastErr()
bool Login()
This method perform the loggin-in into the server just after the hand-shake.
XrdProofConnSender_t fSender
virtual int TryConnect(int=-1)
Connect to remote server.
XrdSecProtocol * Authenticate(char *plist, int lsiz)
Negotiate authentication with the remote server.
XrdSysRecMutex * fConnectInterruptMtx
bool CheckErrorStatus(XrdClientMessage *, int &, const char *, bool)
Check error status.
virtual bool Init(const char *url=0, int=-1)
Initialization.
int(* XrdProofConnSender_t)(const char *, int, void *)
static XrdSysPlugin * fgSecPlugin
High level handler of connections to XProofD.
void SetConnectInterrupt()
Interrupt connection attempts.
bool CheckResp(struct ServerResponseHeader *resp, const char *met, bool)
Checks if the server's response is ours.
static void GetRetryParam(int &maxtry, int &timewait)
Retrieve current values of the retry control parameters, numer of retries and wait time between attem...
int GetLowSocket()
Return the socket descriptor of the underlying connection.
bool IsValid() const
Test validity of this connection.
virtual void Close(const char *opt="")
Close connection.
XrdClientPhyConnection * fPhyConn
virtual void SetAsync(XrdClientAbsUnsolMsgHandler *uh, XrdProofConnSender_t=0, void *=0)
Set handler of unsolicited responses.
void ReConnect()
Perform a reconnection attempt when a connection is not valid any more.
XReqErrorType LowWrite(XPClientRequest *, const void *, int)
Send request to server (NB: req is marshalled at this point, so we need also the plain reqDataLen) ...
short GetSessionID() const
static void * fgSecGetProtocol
virtual int ReadRaw(void *buf, int len, XrdClientPhyConnection *p=0)
Low level receive call.
XrdClientAbsUnsolMsgHandler * fUnsolMsgHandler
virtual UnsolRespProcResult ProcessUnsolicitedMsg(XrdClientUnsolMsgSender *s, XrdClientMessage *m)
We are here if an unsolicited response comes from a logical conn The response comes in the form of an...