Definition at line 48 of file XrdProofConn.h.
|
| XrdProofConn (const char *url, char mode='M', int psid=-1, char ver=-1, XrdClientAbsUnsolMsgHandler *uh=0, const char *logbuf=0) |
| Constructor.
|
|
virtual | ~XrdProofConn () |
| Destructor.
|
|
virtual void | Close (const char *opt="") |
| Close connection.
|
|
const char * | GetLastErr () |
|
int | GetLogConnID () const |
|
int | GetLowSocket () |
| Return the socket descriptor of the underlying connection.
|
|
int | GetOpenError () const |
|
int | GetServType () const |
|
short | GetSessionID () const |
|
const char * | GetUrl () |
|
bool | IsValid () const |
| Test validity of this connection.
|
|
XReqErrorType | LowWrite (XPClientRequest *, const void *, int) |
| Send request to server (NB: req is marshalled at this point, so we need also the plain reqDataLen)
|
|
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 XrdClientMessage *, that must NOT be destroyed after processing.
|
|
virtual XrdClientMessage * | ReadMsg () |
| Pickup message from the queue.
|
|
virtual int | ReadRaw (void *buf, int len, XrdClientPhyConnection *p=0) |
| Low level receive call.
|
|
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.
|
|
virtual void | SetAsync (XrdClientAbsUnsolMsgHandler *uh, XrdProofConnSender_t=0, void *=0) |
| Set handler of unsolicited responses.
|
|
void | SetSID (kXR_char *sid) |
| Set our stream id, to match against that one in the server's response.
|
|
virtual int | WriteRaw (const void *buf, int len, XrdClientPhyConnection *p=0) |
| Low level write call.
|
|
Public Member Functions inherited from XrdClientAbsUnsolMsgHandler |
virtual | ~XrdClientAbsUnsolMsgHandler () |
|
|
static void | GetRetryParam (int &maxtry, int &timewait) |
| Retrieve current values of the retry control parameters, numer of retries and wait time between attempts (in seconds).
|
|
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 seconds).
|
|
#include <XrdProofConn.h>
◆ ESrvType
Enumerator |
---|
kSTError | |
kSTNone | |
kSTXProofd | |
kSTProofd | |
Definition at line 56 of file XrdProofConn.h.
◆ XrdProofConn()
XrdProofConn::XrdProofConn |
( |
const char * |
url, |
|
|
char |
m = 'M' , |
|
|
int |
psid = -1 , |
|
|
char |
capver = -1 , |
|
|
XrdClientAbsUnsolMsgHandler * |
uh = 0 , |
|
|
const char * |
logbuf = 0 |
|
) |
| |
Constructor.
Open the connection to a remote XrdProofd instance. The mode 'm' indicates the role of this connection: 'a' Administrator; used by an XPD to contact the head XPD 'i' Internal; used by a TXProofServ to call back its creator (see XrdProofUnixConn) 'M' Client contacting a top master 'm' Top master contacting a submaster 's' Master contacting a slave The buffer 'logbuf' is a null terminated string to be sent over at login. In case of need, internally it is overwritten with a token needed during redirection.
Definition at line 112 of file XrdProofConn.cxx.
◆ ~XrdProofConn()
XrdProofConn::~XrdProofConn |
( |
| ) |
|
|
virtual |
◆ Authenticate()
XrdSecProtocol * XrdProofConn::Authenticate |
( |
char * |
plist, |
|
|
int |
plsiz |
|
) |
| |
|
private |
Negotiate authentication with the remote server.
Tries in turn all available protocols proposed by the server (in plist), starting from the first.
Definition at line 1264 of file XrdProofConn.cxx.
◆ CheckErrorStatus()
◆ CheckResp()
bool XrdProofConn::CheckResp |
( |
struct ServerResponseHeader * |
resp, |
|
|
const char * |
method, |
|
|
bool |
notifyerr |
|
) |
| |
|
private |
Checks if the server's response is ours.
If the response's status is "OK" returns 1; if the status is "redirect", it means that the max number of redirections has been achieved, so returns 0.
Definition at line 727 of file XrdProofConn.cxx.
◆ Close()
void XrdProofConn::Close |
( |
const char * |
opt = "" | ) |
|
|
virtual |
◆ Connect()
void XrdProofConn::Connect |
( |
int |
= -1 | ) |
|
|
privatevirtual |
◆ ConnectInterrupt()
bool XrdProofConn::ConnectInterrupt |
( |
| ) |
|
|
private |
◆ DoHandShake()
Performs initial hand-shake with the server in order to understand which kind of server is there at the other side.
Definition at line 965 of file XrdProofConn.cxx.
◆ GetAccessToSrv()
Gets access to the connected server.
The login and authorization steps are performed here.
Reimplemented in XrdProofPhyConn.
Definition at line 879 of file XrdProofConn.cxx.
◆ GetLastErr()
const char * XrdProofConn::GetLastErr |
( |
| ) |
|
|
inline |
◆ GetLogConnID()
int XrdProofConn::GetLogConnID |
( |
| ) |
const |
|
inline |
◆ GetLowSocket()
int XrdProofConn::GetLowSocket |
( |
| ) |
|
Return the socket descriptor of the underlying connection.
Definition at line 1067 of file XrdProofConn.cxx.
◆ GetOpenError()
int XrdProofConn::GetOpenError |
( |
| ) |
const |
|
inline |
◆ GetRetryParam()
void XrdProofConn::GetRetryParam |
( |
int & |
maxtry, |
|
|
int & |
timewait |
|
) |
| |
|
static |
Retrieve current values of the retry control parameters, numer of retries and wait time between attempts (in seconds).
Definition at line 140 of file XrdProofConn.cxx.
◆ GetServType()
int XrdProofConn::GetServType |
( |
| ) |
const |
|
inline |
◆ GetSessionID()
short XrdProofConn::GetSessionID |
( |
| ) |
const |
|
inline |
◆ GetUrl()
const char * XrdProofConn::GetUrl |
( |
| ) |
|
|
inline |
◆ Init()
bool XrdProofConn::Init |
( |
const char * |
url = 0 , |
|
|
int |
= -1 |
|
) |
| |
|
privatevirtual |
◆ IsValid()
bool XrdProofConn::IsValid |
( |
| ) |
const |
◆ Login()
bool XrdProofConn::Login |
( |
| ) |
|
|
private |
◆ LowWrite()
XReqErrorType XrdProofConn::LowWrite |
( |
XPClientRequest * |
req, |
|
|
const void * |
reqData, |
|
|
int |
reqDataLen |
|
) |
| |
Send request to server (NB: req is marshalled at this point, so we need also the plain reqDataLen)
Definition at line 777 of file XrdProofConn.cxx.
◆ MatchStreamID()
bool XrdProofConn::MatchStreamID |
( |
struct ServerResponseHeader * |
resp | ) |
|
|
private |
◆ ProcessUnsolicitedMsg()
We are here if an unsolicited response comes from a logical conn The response comes in the form of an XrdClientMessage *, that must NOT be destroyed after processing.
It is destroyed by the first sender. Remember that we are in a separate thread, since unsolicited responses are asynchronous by nature.
Implements XrdClientAbsUnsolMsgHandler.
Definition at line 452 of file XrdProofConn.cxx.
◆ ReadMsg()
◆ ReadRaw()
◆ ReConnect()
void XrdProofConn::ReConnect |
( |
| ) |
|
|
private |
Perform a reconnection attempt when a connection is not valid any more.
Definition at line 316 of file XrdProofConn.cxx.
◆ SendRecv()
SendRecv sends a command to the server and to get a response.
The header of the last response is returned as pointer to a XrdClientMessage. The data, if any, are returned in *answData; if *answData == 0 in input, the buffer is internally allocated and must be freed by the caller. If (*answData != 0) the program assumes that the caller has allocated enough bytes to contain the reply.
Definition at line 528 of file XrdProofConn.cxx.
◆ SendReq()
SendReq tries to send a single command for a number of times.
Definition at line 636 of file XrdProofConn.cxx.
◆ SetAsync()
◆ SetConnectInterrupt()
void XrdProofConn::SetConnectInterrupt |
( |
| ) |
|
|
private |
◆ SetInterrupt()
void XrdProofConn::SetInterrupt |
( |
| ) |
|
|
private |
◆ SetRetryParam()
void XrdProofConn::SetRetryParam |
( |
int |
maxtry = 5 , |
|
|
int |
timewait = 2 |
|
) |
| |
|
static |
Change values of the retry control parameters, numer of retries and wait time between attempts (in seconds).
Definition at line 150 of file XrdProofConn.cxx.
◆ SetSID()
void XrdProofConn::SetSID |
( |
kXR_char * |
sid | ) |
|
Set our stream id, to match against that one in the server's response.
Definition at line 769 of file XrdProofConn.cxx.
◆ TryConnect()
int XrdProofConn::TryConnect |
( |
int |
= -1 | ) |
|
|
privatevirtual |
◆ WriteRaw()
◆ TXSocket
◆ TXUnixSocket
◆ XrdProofPhyConn
◆ fCapVer
char XrdProofConn::fCapVer |
|
private |
◆ fConnected
bool XrdProofConn::fConnected |
|
private |
◆ fConnectInterrupt
bool XrdProofConn::fConnectInterrupt |
|
private |
◆ fConnectInterruptMtx
XrdOucRecMutex* XrdProofConn::fConnectInterruptMtx |
|
private |
◆ fgConnMgr
◆ fgMaxTry
int XrdProofConn::fgMaxTry = 5 |
|
staticprivate |
◆ fgSecGetProtocol
void * XrdProofConn::fgSecGetProtocol = 0 |
|
staticprivate |
◆ fgSecPlugin
◆ fgTimeWait
int XrdProofConn::fgTimeWait = 2 |
|
staticprivate |
◆ fHost
XrdOucString XrdProofConn::fHost |
|
private |
◆ fLastErr
XErrorCode XrdProofConn::fLastErr |
|
private |
◆ fLastErrMsg
XrdOucString XrdProofConn::fLastErrMsg |
|
private |
◆ fLogConnID
int XrdProofConn::fLogConnID |
|
private |
◆ fLoginBuffer
XrdOucString XrdProofConn::fLoginBuffer |
|
private |
◆ fMode
◆ fMutex
XrdOucRecMutex* XrdProofConn::fMutex |
|
private |
◆ fOpenSockFD
int XrdProofConn::fOpenSockFD |
|
private |
◆ fPhyConn
◆ fPort
◆ fRemoteProtocol
int XrdProofConn::fRemoteProtocol |
|
private |
◆ fSender
◆ fSenderArg
void* XrdProofConn::fSenderArg |
|
private |
◆ fServerProto
int XrdProofConn::fServerProto |
|
private |
◆ fServerType
◆ fSessionID
short XrdProofConn::fSessionID |
|
private |
◆ fStreamid
kXR_unt16 XrdProofConn::fStreamid |
|
private |
◆ fUnsolMsgHandler
◆ fUrl
◆ fUser
XrdOucString XrdProofConn::fUser |
|
private |
proof/proofd/inc/XrdProofConn.h
proof/proofd/src/XrdProofConn.cxx