xrootd
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
XrdLink Class Reference

#include <XrdLink.hh>

Inheritance diagram for XrdLink:
Inheritance graph
[legend]
Collaboration diagram for XrdLink:
Collaboration graph
[legend]

Public Types

typedef XrdOucSFVec sfVec
 

Public Member Functions

XrdNetAddrInfo * AddrInfo ()
 
int Backlog ()
 
void Bind ()
 
void Bind (pthread_t tid)
 
int Client (char *buff, int blen)
 
int Close (int defer=0)
 
void DoIt ()
 
void Enable ()
 
int FDnum ()
 
int getIOStats (long long &inbytes, long long &outbytes, int &numstall, int &numtardy)
 
XrdProtocolgetProtocol ()
 
void Hold (int lk)
 
const char * Host ()
 
unsigned int Inst ()
 
bool isFlawed ()
 
bool isInstance (unsigned int inst)
 
const char * Name ()
 
const XrdNetAddr * NetAddr ()
 
int Peek (char *buff, int blen, int timeout=-1)
 
int Recv (char *buff, int blen)
 
int Recv (char *buff, int blen, int timeout)
 
int RecvAll (char *buff, int blen, int timeout=-1)
 
int Send (const char *buff, int blen)
 
int Send (const struct iovec *iov, int iocnt, int bytes=0)
 
int Send (const sfVec *sdP, int sdn)
 
void Serialize ()
 
int setEtext (const char *text)
 
void setID (const char *userid, int procid)
 
void setLocation (XrdNetAddrInfo::LocInfo &loc)
 
bool setNB ()
 
XrdProtocolsetProtocol (XrdProtocol *pp)
 
void setRef (int cnt)
 
void Shutdown (bool getLock)
 
void syncStats (int *ctime=0)
 
int Terminate (const XrdLink *owner, int fdnum, unsigned int inst)
 
time_t timeCon ()
 
int UseCnt ()
 
void armBridge ()
 
int hasBridge ()
 
 XrdLink ()
 
 ~XrdLink ()
 

Static Public Member Functions

static XrdLinkAlloc (XrdNetAddr &peer, int opts=0)
 
static XrdLinkfd2link (int fd)
 
static XrdLinkfd2link (int fd, unsigned int inst)
 
static XrdLinkFind (int &curr, XrdLinkMatch *who=0)
 
static int getName (int &curr, char *bname, int blen, XrdLinkMatch *who=0)
 
static void Init (XrdSysError *eP, XrdOucTrace *tP, XrdScheduler *sP)
 
static void Init (XrdInet *iP)
 
static void setKWT (int wkSec, int kwSec)
 
static int Setup (int maxfd, int idlewait)
 
static int Stats (char *buff, int blen, int do_sync=0)
 

Public Attributes

char * ID
 

Static Public Attributes

static int sfOK
 

Private Member Functions

void Reset ()
 
int sendData (const char *Buff, int Blen)
 
- Private Member Functions inherited from XrdJob
 XrdJob (const char *desc="")
 
virtual ~XrdJob ()
 

Private Attributes

long long BytesIn
 
long long BytesInTot
 
long long BytesOut
 
long long BytesOutTot
 
int stallCnt
 
int stallCntTot
 
int tardyCnt
 
int tardyCntTot
 
int SfIntr
 
XrdNetAddr Addr
 
char Uname [24]
 
char Lname [232]
 
char * HostName
 
int HNlen
 
XrdLinkNext
 
XrdSysMutex opMutex
 
XrdSysMutex rdMutex
 
XrdSysMutex wrMutex
 
XrdSysSemaphore IOSemaphore
 
XrdSysCondVarKillcvP
 
XrdSendQ * sendQ
 
XrdProtocolProtocol
 
XrdProtocolProtoAlt
 
XrdPollPoller
 
struct pollfd * PollEnt
 
char * Etext
 
int FD
 
unsigned int Instance
 
time_t conTime
 
int InUse
 
int doPost
 
char LockReads
 
char KeepFD
 
char isEnabled
 
char isIdle
 
char inQ
 
char isBridged
 
char KillCnt
 
- Private Attributes inherited from XrdJob
XrdJobNextJob
 
const char * Comment
 

Static Private Attributes

static XrdSysErrorXrdLog
 
static XrdOucTraceXrdTrace
 
static XrdSchedulerXrdSched
 
static XrdInet * XrdNetTCP
 
static XrdSysMutex LTMutex
 
static XrdLink ** LinkTab
 
static char * LinkBat
 
static unsigned int LinkAlloc
 
static int LTLast
 
static const char * TraceID
 
static int devNull
 
static short killWait
 
static short waitKill
 
static long long LinkBytesIn
 
static long long LinkBytesOut
 
static long long LinkConTime
 
static long long LinkCountTot
 
static int LinkCount
 
static int LinkCountMax
 
static int LinkTimeOuts
 
static int LinkStalls
 
static int LinkSfIntr
 
static XrdSysMutex statsMutex
 
static const char KillMax = 60
 
static const char KillMsk = 0x7f
 
static const char KillXwt = 0x80
 

Friends

class XrdLinkScan
 
class XrdPoll
 
class XrdPollPoll
 
class XrdPollDev
 
class XrdPollE
 

Member Typedef Documentation

◆ sfVec

typedef XrdOucSFVec XrdLink::sfVec

Constructor & Destructor Documentation

◆ XrdLink()

XrdLink::XrdLink ( )

Referenced by hasBridge().

◆ ~XrdLink()

XrdLink::~XrdLink ( )
inline

References Reset(), and sendData().

Member Function Documentation

◆ AddrInfo()

XrdNetAddrInfo* XrdLink::AddrInfo ( )
inline

Obtain the address information for this link.

Returns
Pointer to the XrdAddrInfo object. The pointer is valid while the end-point is connected.

References Addr, Alloc(), and Backlog().

◆ Alloc()

static XrdLink* XrdLink::Alloc ( XrdNetAddr &  peer,
int  opts = 0 
)
static

Allocate a new link object.

Parameters
peerThe connection information for the endpoint.
optsProcessing options: XRDLINK_NOCLOSE - do not close the FD upon recycling. XRDLINK_RDLOCK - obtain a lock prior to reading data.
Returns
!0 The pointer to the new object. =0 A new link object could not be allocated.

Referenced by AddrInfo().

◆ armBridge()

void XrdLink::armBridge ( )
inline

References isBridged.

◆ Backlog()

int XrdLink::Backlog ( )

Referenced by AddrInfo().

◆ Bind() [1/2]

void XrdLink::Bind ( )
inline

◆ Bind() [2/2]

void XrdLink::Bind ( pthread_t  tid)
inline

References Client(), Close(), DoIt(), and Enable().

◆ Client()

int XrdLink::Client ( char *  buff,
int  blen 
)

Referenced by Bind().

◆ Close()

int XrdLink::Close ( int  defer = 0)

Referenced by Bind().

◆ DoIt()

void XrdLink::DoIt ( )
virtual

Implements XrdJob.

Referenced by Bind().

◆ Enable()

void XrdLink::Enable ( )

Referenced by Bind().

◆ fd2link() [1/2]

static XrdLink* XrdLink::fd2link ( int  fd)
inlinestatic

References LinkBat, LinkTab, and LTLast.

◆ fd2link() [2/2]

static XrdLink* XrdLink::fd2link ( int  fd,
unsigned int  inst 
)
inlinestatic

References Find(), Instance, LinkBat, LinkTab, and LTLast.

◆ FDnum()

int XrdLink::FDnum ( )
inline

References FD.

◆ Find()

static XrdLink* XrdLink::Find ( int &  curr,
XrdLinkMatch who = 0 
)
static

Referenced by fd2link().

◆ getIOStats()

int XrdLink::getIOStats ( long long &  inbytes,
long long &  outbytes,
int &  numstall,
int &  numtardy 
)
inline

◆ getName()

static int XrdLink::getName ( int &  curr,
char *  bname,
int  blen,
XrdLinkMatch who = 0 
)
static

Referenced by getIOStats().

◆ getProtocol()

XrdProtocol* XrdLink::getProtocol ( )
inline

References Protocol.

◆ hasBridge()

int XrdLink::hasBridge ( )
inline

References isBridged, and XrdLink().

◆ Hold()

void XrdLink::Hold ( int  lk)
inline

◆ Host()

const char* XrdLink::Host ( )
inline

Get the fully qualified name of the endpoint.

Returns
Pointer to fully qualified host name. The contents are valid while the endpoint is connected.

References HostName.

◆ Init() [1/2]

static void XrdLink::Init ( XrdSysError eP,
XrdOucTrace tP,
XrdScheduler sP 
)
inlinestatic

References XrdLog, XrdSched, and XrdTrace.

◆ Init() [2/2]

static void XrdLink::Init ( XrdInet *  iP)
inlinestatic

References XrdNetTCP.

◆ Inst()

unsigned int XrdLink::Inst ( )
inline

Obtain the link's instance number.

Returns
The link's instance number.

References Instance.

◆ isFlawed()

bool XrdLink::isFlawed ( )
inline

Indicate whether or not the link has an outstanding error.

Returns
True the link has an outstanding error. the link has no outstanding error.

References Etext.

◆ isInstance()

bool XrdLink::isInstance ( unsigned int  inst)
inline

Indicate whether or not this link is of a particular instance. only be used for display and not for security purposes.

Parameters
instthe expected instance number.
Returns
True the link matches the instance number. the link differs the instance number.

References FD, and Instance.

◆ Name()

const char* XrdLink::Name ( )
inline

Obtain the domain trimmed name of the end-point. The returned value should only be used for display and not for security purposes.

Returns
Pointer to the name that remains valid during the link's lifetime.

References Lname.

◆ NetAddr()

const XrdNetAddr* XrdLink::NetAddr ( )
inline

Obtain the network address object for this link. The returned value is valid as long as the end-point is connected. Otherwise, it may change.

Returns
Pointer to the object and remains valid during the link's lifetime.

References Addr, Peek(), Recv(), RecvAll(), and Send().

◆ Peek()

int XrdLink::Peek ( char *  buff,
int  blen,
int  timeout = -1 
)

Referenced by NetAddr().

◆ Recv() [1/2]

int XrdLink::Recv ( char *  buff,
int  blen 
)

Referenced by NetAddr().

◆ Recv() [2/2]

int XrdLink::Recv ( char *  buff,
int  blen,
int  timeout 
)

◆ RecvAll()

int XrdLink::RecvAll ( char *  buff,
int  blen,
int  timeout = -1 
)

Referenced by NetAddr().

◆ Reset()

void XrdLink::Reset ( )
private

Referenced by ~XrdLink().

◆ Send() [1/3]

int XrdLink::Send ( const char *  buff,
int  blen 
)

Referenced by NetAddr().

◆ Send() [2/3]

int XrdLink::Send ( const struct iovec *  iov,
int  iocnt,
int  bytes = 0 
)

◆ Send() [3/3]

int XrdLink::Send ( const sfVec sdP,
int  sdn 
)

◆ sendData()

int XrdLink::sendData ( const char *  Buff,
int  Blen 
)
private

Referenced by ~XrdLink().

◆ Serialize()

void XrdLink::Serialize ( )

◆ setEtext()

int XrdLink::setEtext ( const char *  text)

◆ setID()

void XrdLink::setID ( const char *  userid,
int  procid 
)

◆ setKWT()

static void XrdLink::setKWT ( int  wkSec,
int  kwSec 
)
static

◆ setLocation()

void XrdLink::setLocation ( XrdNetAddrInfo::LocInfo &  loc)
inline

◆ setNB()

bool XrdLink::setNB ( )

Referenced by setLocation().

◆ setProtocol()

XrdProtocol* XrdLink::setProtocol ( XrdProtocol pp)

Referenced by setLocation().

◆ setRef()

void XrdLink::setRef ( int  cnt)

Referenced by setLocation().

◆ Setup()

static int XrdLink::Setup ( int  maxfd,
int  idlewait 
)
static

Referenced by setLocation().

◆ Shutdown()

void XrdLink::Shutdown ( bool  getLock)

Referenced by setLocation().

◆ Stats()

static int XrdLink::Stats ( char *  buff,
int  blen,
int  do_sync = 0 
)
static

Referenced by setLocation().

◆ syncStats()

void XrdLink::syncStats ( int *  ctime = 0)

Referenced by setLocation().

◆ Terminate()

int XrdLink::Terminate ( const XrdLink owner,
int  fdnum,
unsigned int  inst 
)

Referenced by setLocation().

◆ timeCon()

time_t XrdLink::timeCon ( )
inline

References conTime.

◆ UseCnt()

int XrdLink::UseCnt ( )
inline

References InUse.

Friends And Related Function Documentation

◆ XrdLinkScan

friend class XrdLinkScan
friend

◆ XrdPoll

friend class XrdPoll
friend

◆ XrdPollDev

friend class XrdPollDev
friend

◆ XrdPollE

friend class XrdPollE
friend

◆ XrdPollPoll

friend class XrdPollPoll
friend

Member Data Documentation

◆ Addr

XrdNetAddr XrdLink::Addr
private

Referenced by AddrInfo(), NetAddr(), and setLocation().

◆ BytesIn

long long XrdLink::BytesIn
private

Referenced by getIOStats().

◆ BytesInTot

long long XrdLink::BytesInTot
private

Referenced by getIOStats().

◆ BytesOut

long long XrdLink::BytesOut
private

Referenced by getIOStats().

◆ BytesOutTot

long long XrdLink::BytesOutTot
private

Referenced by getIOStats().

◆ conTime

time_t XrdLink::conTime
private

Referenced by timeCon().

◆ devNull

int XrdLink::devNull
staticprivate

◆ doPost

int XrdLink::doPost
private

◆ Etext

char* XrdLink::Etext
private

Referenced by isFlawed().

◆ FD

int XrdLink::FD
private

Referenced by FDnum(), and isInstance().

◆ HNlen

int XrdLink::HNlen
private

◆ HostName

char* XrdLink::HostName
private

Referenced by Host().

◆ ID

char* XrdLink::ID

◆ inQ

char XrdLink::inQ
private

◆ Instance

unsigned int XrdLink::Instance
private

Referenced by fd2link(), Inst(), and isInstance().

◆ InUse

int XrdLink::InUse
private

Referenced by getIOStats(), and UseCnt().

◆ IOSemaphore

XrdSysSemaphore XrdLink::IOSemaphore
private

◆ isBridged

char XrdLink::isBridged
private

Referenced by armBridge(), and hasBridge().

◆ isEnabled

char XrdLink::isEnabled
private

◆ isIdle

char XrdLink::isIdle
private

◆ KeepFD

char XrdLink::KeepFD
private

◆ KillCnt

char XrdLink::KillCnt
private

◆ KillcvP

XrdSysCondVar* XrdLink::KillcvP
private

◆ KillMax

const char XrdLink::KillMax = 60
staticprivate

◆ KillMsk

const char XrdLink::KillMsk = 0x7f
staticprivate

◆ killWait

short XrdLink::killWait
staticprivate

◆ KillXwt

const char XrdLink::KillXwt = 0x80
staticprivate

◆ LinkAlloc

unsigned int XrdLink::LinkAlloc
staticprivate

◆ LinkBat

char* XrdLink::LinkBat
staticprivate

Referenced by fd2link().

◆ LinkBytesIn

long long XrdLink::LinkBytesIn
staticprivate

◆ LinkBytesOut

long long XrdLink::LinkBytesOut
staticprivate

◆ LinkConTime

long long XrdLink::LinkConTime
staticprivate

◆ LinkCount

int XrdLink::LinkCount
staticprivate

◆ LinkCountMax

int XrdLink::LinkCountMax
staticprivate

◆ LinkCountTot

long long XrdLink::LinkCountTot
staticprivate

◆ LinkSfIntr

int XrdLink::LinkSfIntr
staticprivate

◆ LinkStalls

int XrdLink::LinkStalls
staticprivate

◆ LinkTab

XrdLink** XrdLink::LinkTab
staticprivate

Referenced by fd2link().

◆ LinkTimeOuts

int XrdLink::LinkTimeOuts
staticprivate

◆ Lname

char XrdLink::Lname[232]
private

Referenced by Name().

◆ LockReads

char XrdLink::LockReads
private

◆ LTLast

int XrdLink::LTLast
staticprivate

Referenced by fd2link().

◆ LTMutex

XrdSysMutex XrdLink::LTMutex
staticprivate

◆ Next

XrdLink* XrdLink::Next
private

◆ opMutex

XrdSysMutex XrdLink::opMutex
private

Referenced by Hold().

◆ PollEnt

struct pollfd* XrdLink::PollEnt
private

◆ Poller

XrdPoll* XrdLink::Poller
private

◆ ProtoAlt

XrdProtocol* XrdLink::ProtoAlt
private

◆ Protocol

XrdProtocol* XrdLink::Protocol
private

Referenced by getProtocol().

◆ rdMutex

XrdSysMutex XrdLink::rdMutex
private

◆ sendQ

XrdSendQ* XrdLink::sendQ
private

◆ SfIntr

int XrdLink::SfIntr
private

◆ sfOK

int XrdLink::sfOK
static

◆ stallCnt

int XrdLink::stallCnt
private

Referenced by getIOStats().

◆ stallCntTot

int XrdLink::stallCntTot
private

Referenced by getIOStats().

◆ statsMutex

XrdSysMutex XrdLink::statsMutex
staticprivate

◆ tardyCnt

int XrdLink::tardyCnt
private

Referenced by getIOStats().

◆ tardyCntTot

int XrdLink::tardyCntTot
private

Referenced by getIOStats().

◆ TraceID

const char* XrdLink::TraceID
staticprivate

◆ Uname

char XrdLink::Uname[24]
private

◆ waitKill

short XrdLink::waitKill
staticprivate

◆ wrMutex

XrdSysMutex XrdLink::wrMutex
private

◆ XrdLog

XrdSysError* XrdLink::XrdLog
staticprivate

Referenced by Init().

◆ XrdNetTCP

XrdInet* XrdLink::XrdNetTCP
staticprivate

Referenced by Init().

◆ XrdSched

XrdScheduler* XrdLink::XrdSched
staticprivate

Referenced by Init().

◆ XrdTrace

XrdOucTrace* XrdLink::XrdTrace
staticprivate

Referenced by Init().


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