12 #ifndef ROOT_XrdProofConn 13 #define ROOT_XrdProofConn 25 #define DFLT_CONNECTMAXTRY 10 27 #ifndef ROOT_XrdSysToOuc 30 #ifndef ROOT_XProofProtocol 33 #ifndef ROOT_XProofProtUtils 36 #ifndef XRC_UNSOLMSG_H 39 #ifndef _XRC_URLINFO_H 42 #ifndef __OUC_STRING_H__ 43 #include "XrdOuc/XrdOucString.hh" 114 bool CheckResp(
struct ServerResponseHeader *resp,
115 const char *met,
bool);
116 virtual void Connect(
int = -1);
122 virtual bool Init(
const char *url = 0,
int = -1);
126 const void *reqData,
char **answData);
134 XrdProofConn(
const char *url,
char mode =
'M',
int psid = -1,
char ver = -1,
138 virtual void Close(
const char *opt =
"");
156 char **answData,
const char *CmdName,
159 void SetSID(kXR_char *sid);
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()
int(* XrdProofConnSender_t)(const char *, int, void *)
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.
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...