xrootd
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
XrdClientConn Class Reference

#include <XrdClientConn.hh>

Collaboration diagram for XrdClientConn:
Collaboration graph
[legend]

List of all members.

Classes

struct  SessionIDInfo

Public Types

enum  ESrvErrorHandlerRetval {
  kSEHRReturnMsgToCaller = 0, kSEHRBreakLoop = 1, kSEHRContinue = 2, kSEHRReturnNoMsgToCaller = 3,
  kSEHRRedirLimitReached = 4
}
enum  EThreeStateReadHandler { kTSRHReturnMex = 0, kTSRHReturnNullMex = 1, kTSRHContinue = 2 }

Public Member Functions

 XrdClientConn ()
virtual ~XrdClientConn ()
bool CacheWillFit (long long bytes)
bool CheckHostDomain (XrdOucString hostToCheck)
short Connect (XrdClientUrlInfo Host2Conn, XrdClientAbsUnsolMsgHandler *unsolhandler)
void Disconnect (bool ForcePhysicalDisc)
virtual bool GetAccessToSrv ()
XReqErrorType GoBackToRedirector ()
XrdOucString GetClientHostDomain ()
long GetDataFromCache (const void *buffer, long long begin_offs, long long end_offs, bool PerfCalc, XrdClientIntvList &missingblks, long &outstandingblks)
bool SubmitDataToCache (XrdClientMessage *xmsg, long long begin_offs, long long end_offs)
bool SubmitRawDataToCache (const void *buffer, long long begin_offs, long long end_offs)
void SubmitPlaceholderToCache (long long begin_offs, long long end_offs)
void RemoveAllDataFromCache (bool keepwriteblocks=true)
void RemoveDataFromCache (long long begin_offs, long long end_offs, bool remove_overlapped=false)
void RemovePlaceholdersFromCache ()
void PrintCache ()
bool GetCacheInfo (int &size, long long &bytessubmitted, long long &byteshit, long long &misscount, float &missrate, long long &readreqcnt, float &bytesusefulness)
void SetCacheSize (int CacheSize)
void SetCacheRmPolicy (int RmPolicy)
void UnPinCacheBlk (long long begin_offs, long long end_offs)
int GetLogConnID () const
ERemoteServerType GetServerType () const
kXR_unt16 GetStreamID () const
XrdClientUrlInfoGetLBSUrl ()
XrdClientUrlInfoGetMetaUrl ()
XrdClientUrlInfo GetCurrentUrl ()
XrdClientUrlInfo GetRedirUrl ()
XErrorCode GetOpenError () const
virtual XReqErrorType GoToAnotherServer (XrdClientUrlInfo &newdest)
virtual XReqErrorType GoToMetaManager ()
bool IsConnected () const
bool IsPhyConnConnected ()
void ClearLastServerError ()
UnsolRespProcResult ProcessAsynResp (XrdClientMessage *unsolmsg)
virtual bool SendGenCommand (ClientRequest *req, const void *reqMoreData, void **answMoreDataAllocated, void *answMoreData, bool HasToAlloc, char *CmdName, int substreamid=0)
int GetOpenSockFD () const
void SetClientHostDomain (const char *src)
void SetConnected (bool conn)
void SetOpenError (XErrorCode err)
int GetParallelStreamToUse (int reqsperstream)
int GetParallelStreamCount ()
void SetRedirHandler (XrdClientAbs *rh)
void SetRequestedDestHost (char *newh, kXR_int32 port)
void SetREQPauseState (kXR_int32 wsec)
void SetREQDelayedConnectState (kXR_int32 wsec)
void SetSID (kXR_char *sid)
void SetUrl (XrdClientUrlInfo thisUrl)
XReqErrorType WriteToServer_Async (ClientRequest *req, const void *reqMoreData, int substreamid=0)
void GetSessionID (SessionIDInfo &sess)
long GetServerProtocol ()
short GetMaxRedirCnt () const
void SetMaxRedirCnt (short mx)
short GetRedirCnt () const
bool DoWriteSoftCheckPoint ()
bool DoWriteHardCheckPoint ()
void UnPinCacheBlk ()
void SetOpTimeLimit (int delta_secs)
bool IsOpTimeLimitElapsed (time_t timenow)

Static Public Member Functions

static XrdClientPhyConnectionGetPhyConn (int LogConnID)
static XrdClientConnectionMgrGetConnectionMgr ()
static void DelSessionIDRepo ()

Public Attributes

int fLastDataBytesRecv
int fLastDataBytesSent
XErrorCode fOpenError
XrdOucString fRedirOpaque
struct ServerResponseHeader LastServerResp
struct ServerResponseBody_Error LastServerError

Protected Member Functions

void SetLogConnID (int cid)
void SetStreamID (kXR_unt16 sid)

Protected Attributes

XrdClientAbsUnsolMsgHandlerfUnsolMsgHandler
XrdClientUrlInfo fUrl
XrdClientUrlInfofLBSUrl
XrdClientUrlInfo fREQUrl
short fGlobalRedirCnt

Private Member Functions

bool CheckErrorStatus (XrdClientMessage *, short &, char *)
void CheckPort (int &port)
void CheckREQPauseState ()
void CheckREQConnectWaitState ()
bool CheckResp (struct ServerResponseHeader *resp, const char *method)
XrdClientMessageClientServerCmd (ClientRequest *req, const void *reqMoreData, void **answMoreDataAllocated, void *answMoreData, bool HasToAlloc, int substreamid=0)
XrdSecProtocolDoAuthentication (char *plist, int plsiz)
ERemoteServerType DoHandShake (short log)
bool DoLogin ()
bool DomainMatcher (XrdOucString dom, XrdOucString domlist)
XrdOucString GetDomainToMatch (XrdOucString hostname)
ESrvErrorHandlerRetval HandleServerError (XReqErrorType &, XrdClientMessage *, ClientRequest *)
bool MatchStreamid (struct ServerResponseHeader *ServerResponse)
bool PanicClose ()
XrdOucString ParseDomainFromHostname (XrdOucString hostname)
XrdClientMessageReadPartialAnswer (XReqErrorType &, size_t &, ClientRequest *, bool, void **, EThreeStateReadHandler &)
XReqErrorType WriteToServer (ClientRequest *req, const void *reqMoreData, short LogConnID, int substreamid=0)
bool WaitResp (int secsmax)

Private Attributes

bool fConnected
bool fGettingAccessToSrv
time_t fGlobalRedirLastUpdateTimestamp
int fLogConnID
kXR_unt16 fPrimaryStreamid
short fMaxGlobalRedirCnt
XrdClientReadCachefMainReadCache
time_t fOpTimeLimit
XrdClientAbsfRedirHandler
XrdOucString fRedirInternalToken
XrdSysCondVarfREQWaitResp
ServerResponseBody_Attn_asynrespfREQWaitRespData
time_t fREQWaitTimeLimit
XrdSysCondVarfREQWait
time_t fREQConnectWaitTimeLimit
XrdSysCondVarfREQConnectWait
long fServerProto
ERemoteServerType fServerType
SessionIDInfo mySessionID
int fOpenSockFD
XrdSysCondVarfWriteWaitAck
XrdClientVector< ClientRequestfWriteReqsToRetry
XrdClientUrlInfofMetaUrl
bool fLBSIsMeta

Static Private Attributes

static XrdOucString fgClientHostDomain
static XrdSysMutex fSessionIDRMutex
static XrdOucHash< SessionIDInfofSessionIDRepo
static XrdClientConnectionMgrfgConnectionMgr = 0

Member Enumeration Documentation

Enumerator:
kSEHRReturnMsgToCaller 
kSEHRBreakLoop 
kSEHRContinue 
kSEHRReturnNoMsgToCaller 
kSEHRRedirLimitReached 
Enumerator:
kTSRHReturnMex 
kTSRHReturnNullMex 
kTSRHContinue 

Constructor & Destructor Documentation

XrdClientConn::XrdClientConn ( )
XrdClientConn::~XrdClientConn ( ) [virtual]

Member Function Documentation

bool XrdClientConn::CacheWillFit ( long long  bytes) [inline]
bool XrdClientConn::CheckErrorStatus ( XrdClientMessage mex,
short &  Retry,
char *  CmdName 
) [private]
bool XrdClientConn::CheckHostDomain ( XrdOucString  hostToCheck)
void XrdClientConn::CheckPort ( int &  port) [private]
void XrdClientConn::CheckREQConnectWaitState ( ) [private]
void XrdClientConn::CheckREQPauseState ( ) [private]
bool XrdClientConn::CheckResp ( struct ServerResponseHeader resp,
const char *  method 
) [private]
void XrdClientConn::ClearLastServerError ( ) [inline]
XrdClientMessage * XrdClientConn::ClientServerCmd ( ClientRequest req,
const void *  reqMoreData,
void **  answMoreDataAllocated,
void *  answMoreData,
bool  HasToAlloc,
int  substreamid = 0 
) [private]
short XrdClientConn::Connect ( XrdClientUrlInfo  Host2Conn,
XrdClientAbsUnsolMsgHandler unsolhandler 
)
static void XrdClientConn::DelSessionIDRepo ( ) [inline, static]
void XrdClientConn::Disconnect ( bool  ForcePhysicalDisc)
XrdSecProtocol * XrdClientConn::DoAuthentication ( char *  plist,
int  plsiz 
) [private]
ERemoteServerType XrdClientConn::DoHandShake ( short  log) [private]

Referenced by GetAccessToSrv().

bool XrdClientConn::DoLogin ( ) [private]
bool XrdClientConn::DomainMatcher ( XrdOucString  dom,
XrdOucString  domlist 
) [private]
bool XrdClientConn::DoWriteHardCheckPoint ( )
bool XrdClientConn::DoWriteSoftCheckPoint ( )
bool XrdClientConn::GetAccessToSrv ( ) [virtual]
bool XrdClientConn::GetCacheInfo ( int &  size,
long long &  bytessubmitted,
long long &  byteshit,
long long &  misscount,
float &  missrate,
long long &  readreqcnt,
float &  bytesusefulness 
) [inline]
XrdOucString XrdClientConn::GetClientHostDomain ( ) [inline]

References fgClientHostDomain.

static XrdClientConnectionMgr* XrdClientConn::GetConnectionMgr ( ) [inline, static]

References fgConnectionMgr.

XrdClientUrlInfo XrdClientConn::GetCurrentUrl ( ) [inline]
long XrdClientConn::GetDataFromCache ( const void *  buffer,
long long  begin_offs,
long long  end_offs,
bool  PerfCalc,
XrdClientIntvList missingblks,
long &  outstandingblks 
)
XrdOucString XrdClientConn::GetDomainToMatch ( XrdOucString  hostname) [private]
XrdClientUrlInfo* XrdClientConn::GetLBSUrl ( ) [inline]

References fLBSUrl.

Referenced by XrdClient::TryOpen().

int XrdClientConn::GetLogConnID ( ) const [inline]
short XrdClientConn::GetMaxRedirCnt ( ) const [inline]
XrdClientUrlInfo* XrdClientConn::GetMetaUrl ( ) [inline]

References fMetaUrl.

Referenced by XrdClient::TryOpen().

XErrorCode XrdClientConn::GetOpenError ( ) const [inline]

References fOpenError.

int XrdClientConn::GetOpenSockFD ( ) const [inline]

References fOpenSockFD.

int XrdClientConn::GetParallelStreamCount ( )
int XrdClientConn::GetParallelStreamToUse ( int  reqsperstream)
XrdClientPhyConnection * XrdClientConn::GetPhyConn ( int  LogConnID) [static]
short XrdClientConn::GetRedirCnt ( ) const [inline]

References fGlobalRedirCnt.

Referenced by XrdClient::Open(), and XrdClient::TryOpen().

XrdClientUrlInfo XrdClientConn::GetRedirUrl ( ) [inline]

References fREQUrl.

long XrdClientConn::GetServerProtocol ( ) [inline]
ERemoteServerType XrdClientConn::GetServerType ( ) const [inline]
void XrdClientConn::GetSessionID ( SessionIDInfo sess) [inline]
kXR_unt16 XrdClientConn::GetStreamID ( ) const [inline]
XReqErrorType XrdClientConn::GoBackToRedirector ( )
XReqErrorType XrdClientConn::GoToAnotherServer ( XrdClientUrlInfo newdest) [virtual]
XReqErrorType XrdClientConn::GoToMetaManager ( ) [virtual]
XrdClientConn::ESrvErrorHandlerRetval XrdClientConn::HandleServerError ( XReqErrorType errorType,
XrdClientMessage xmsg,
ClientRequest req 
) [private]
bool XrdClientConn::IsConnected ( ) const [inline]
bool XrdClientConn::IsOpTimeLimitElapsed ( time_t  timenow)
bool XrdClientConn::IsPhyConnConnected ( )
bool XrdClientConn::MatchStreamid ( struct ServerResponseHeader ServerResponse) [private]
bool XrdClientConn::PanicClose ( ) [private]
XrdOucString XrdClientConn::ParseDomainFromHostname ( XrdOucString  hostname) [private]
void XrdClientConn::PrintCache ( ) [inline]
UnsolRespProcResult XrdClientConn::ProcessAsynResp ( XrdClientMessage unsolmsg)
XrdClientMessage * XrdClientConn::ReadPartialAnswer ( XReqErrorType errorType,
size_t &  TotalBlkSize,
ClientRequest req,
bool  HasToAlloc,
void **  tmpMoreData,
EThreeStateReadHandler what_to_do 
) [private]
void XrdClientConn::RemoveAllDataFromCache ( bool  keepwriteblocks = true) [inline]
void XrdClientConn::RemoveDataFromCache ( long long  begin_offs,
long long  end_offs,
bool  remove_overlapped = false 
) [inline]
void XrdClientConn::RemovePlaceholdersFromCache ( ) [inline]
bool XrdClientConn::SendGenCommand ( ClientRequest req,
const void *  reqMoreData,
void **  answMoreDataAllocated,
void *  answMoreData,
bool  HasToAlloc,
char *  CmdName,
int  substreamid = 0 
) [virtual]

References FALSE, ClientRequest::header, ClientRequestHdr::requestid, kXR_open, fOpenError, CheckREQPauseState(), Info, XrdClientDebug::kHIDEBUG, GetServerProtocol(), ClientRequest::open, ClientOpenRequest::options, kXR_retstat, ClientOpenRequest::dlen, fRedirOpaque, XrdOucString::length(), XrdOucString::c_str(), ClientServerCmd(), LastServerResp, XrdClientMessage::fHdr, IsOpTimeLimitElapsed(), Error, convertRequestIdToChar(), TRUE, fGlobalRedirCnt, fMaxGlobalRedirCnt, XrdClientMessage::IsError(), fUrl, XrdClientUrlInfo::Host, XrdClientUrlInfo::Port, kXR_maxReqRetry, kXR_bind, ServerResponseHeader::status, kXR_ok, kXR_read, kXR_write, kXR_sync, kXR_close, CheckResp(), kXR_waitresp, XrdClientMessage::GetData(), WaitResp(), fREQWaitRespData, ServerResponseBody_Attn_asynresp::resphdr, kXR_wait, ServerResponseHeader::dlen, ServerResponseBody_Attn_asynresp::respdata, CheckErrorStatus(), and kXR_refresh.

Referenced by XrdClient::Read(), XrdClient::Write(), XrdClient::Sync(), XrdClient::LowOpen(), XrdClient::Stat(), XrdClient::Close(), XrdClient::Truncate(), XrdClientAbs::Query(), XrdClientAdmin::Stat(), XrdClientAdmin::Stat_vfs(), XrdClientAdmin::SysStatX(), XrdClientAdmin::Rmdir(), XrdClientAdmin::Rm(), XrdClientAdmin::Chmod(), XrdClientAdmin::Mkdir(), XrdClientAdmin::Mv(), XrdClientAdmin::Protocol(), XrdClientAdmin::Prepare(), XrdClientAdmin::DirList_low(), XrdClientAdmin::GetChecksum(), XrdClientAdmin::LocalLocate(), XrdClientAdmin::Truncate(), XrdClientAdmin::GetSpaceInfo(), DoLogin(), DoAuthentication(), DoWriteSoftCheckPoint(), XrdClientMStream::EstablishParallelStreams(), and XrdClientReadV::ReqReadV().

void XrdClientConn::SetCacheRmPolicy ( int  RmPolicy) [inline]
void XrdClientConn::SetCacheSize ( int  CacheSize) [inline]
void XrdClientConn::SetClientHostDomain ( const char *  src) [inline]

References fgClientHostDomain.

void XrdClientConn::SetConnected ( bool  conn) [inline]

References fConnected.

void XrdClientConn::SetLogConnID ( int  cid) [inline, protected]

References fLogConnID.

void XrdClientConn::SetMaxRedirCnt ( short  mx) [inline]

References fMaxGlobalRedirCnt.

void XrdClientConn::SetOpenError ( XErrorCode  err) [inline]

References fOpenError.

void XrdClientConn::SetOpTimeLimit ( int  delta_secs)
void XrdClientConn::SetRedirHandler ( XrdClientAbs rh) [inline]
void XrdClientConn::SetREQDelayedConnectState ( kXR_int32  wsec) [inline]
void XrdClientConn::SetREQPauseState ( kXR_int32  wsec) [inline]
void XrdClientConn::SetRequestedDestHost ( char *  newh,
kXR_int32  port 
) [inline]
void XrdClientConn::SetSID ( kXR_char sid)
void XrdClientConn::SetStreamID ( kXR_unt16  sid) [inline, protected]

References fPrimaryStreamid.

void XrdClientConn::SetUrl ( XrdClientUrlInfo  thisUrl) [inline]

References fUrl.

Referenced by XrdClient::Open(), and XrdClientAdmin::Connect().

bool XrdClientConn::SubmitDataToCache ( XrdClientMessage xmsg,
long long  begin_offs,
long long  end_offs 
)
void XrdClientConn::SubmitPlaceholderToCache ( long long  begin_offs,
long long  end_offs 
) [inline]
bool XrdClientConn::SubmitRawDataToCache ( const void *  buffer,
long long  begin_offs,
long long  end_offs 
)
void XrdClientConn::UnPinCacheBlk ( long long  begin_offs,
long long  end_offs 
) [inline]
void XrdClientConn::UnPinCacheBlk ( )

Referenced by DoWriteSoftCheckPoint().

bool XrdClientConn::WaitResp ( int  secsmax) [private]
XReqErrorType XrdClientConn::WriteToServer ( ClientRequest req,
const void *  reqMoreData,
short  LogConnID,
int  substreamid = 0 
) [private]
XReqErrorType XrdClientConn::WriteToServer_Async ( ClientRequest req,
const void *  reqMoreData,
int  substreamid = 0 
)

Member Data Documentation

bool XrdClientConn::fConnected [private]

Referenced by XrdClientConn(), and GetConnectionMgr().

short XrdClientConn::fGlobalRedirCnt [protected]

Referenced by XrdClientConn().

Referenced by ReadPartialAnswer().

Referenced by WriteToServer().

bool XrdClientConn::fLBSIsMeta [private]
time_t XrdClientConn::fOpTimeLimit [private]

Referenced by DoLogin(), and HandleServerError().

Referenced by DoLogin(), and DelSessionIDRepo().

Referenced by DoLogin(), and DelSessionIDRepo().

Referenced by DoLogin(), and GetSessionID().


The documentation for this class was generated from the following files: