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 ()
 
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)
 
XrdProtocolsetProtocol (XrdProtocol *pp)
 
void setRef (int cnt)
 
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
 
pthread_t TID
 
XrdSysMutex opMutex
 
XrdSysMutex rdMutex
 
XrdSysMutex wrMutex
 
XrdSysSemaphore IOSemaphore
 
XrdSysCondVarKillcvP
 
XrdLinkNext
 
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

typedef XrdOucSFVec XrdLink::sfVec

Constructor & Destructor Documentation

XrdLink::XrdLink ( )
XrdLink::~XrdLink ( )
inline

Member Function Documentation

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.

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.
void XrdLink::armBridge ( )
inline

References isBridged.

void XrdLink::Bind ( )
inline
void XrdLink::Bind ( pthread_t  tid)
inline
int XrdLink::Client ( char *  buff,
int  blen 
)
int XrdLink::Close ( int  defer = 0)
void XrdLink::DoIt ( )
virtual

Implements XrdJob.

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

References LinkBat, LinkTab, and LTLast.

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

References Instance, LinkBat, LinkTab, and LTLast.

int XrdLink::FDnum ( )
inline

References FD.

static XrdLink* XrdLink::Find ( int &  curr,
XrdLinkMatch who = 0 
)
static
int XrdLink::getIOStats ( long long &  inbytes,
long long &  outbytes,
int &  numstall,
int &  numtardy 
)
inline
static int XrdLink::getName ( int &  curr,
char *  bname,
int  blen,
XrdLinkMatch who = 0 
)
static
XrdProtocol* XrdLink::getProtocol ( )
inline

References Protocol.

int XrdLink::hasBridge ( )
inline

References isBridged.

void XrdLink::Hold ( int  lk)
inline
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.

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

References XrdLog, XrdSched, and XrdTrace.

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

References XrdNetTCP.

unsigned int XrdLink::Inst ( )
inline

Obtain the link's instance number.

Returns
The link's instance number.

References Instance.

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.

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.

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.

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.

int XrdLink::Peek ( char *  buff,
int  blen,
int  timeout = -1 
)
int XrdLink::Recv ( char *  buff,
int  blen 
)
int XrdLink::Recv ( char *  buff,
int  blen,
int  timeout 
)
int XrdLink::RecvAll ( char *  buff,
int  blen,
int  timeout = -1 
)
void XrdLink::Reset ( )
private
int XrdLink::Send ( const char *  buff,
int  blen 
)
int XrdLink::Send ( const struct iovec *  iov,
int  iocnt,
int  bytes = 0 
)
int XrdLink::Send ( const sfVec sdP,
int  sdn 
)
int XrdLink::sendData ( const char *  Buff,
int  Blen 
)
private
void XrdLink::Serialize ( )
int XrdLink::setEtext ( const char *  text)
void XrdLink::setID ( const char *  userid,
int  procid 
)
static void XrdLink::setKWT ( int  wkSec,
int  kwSec 
)
static
void XrdLink::setLocation ( XrdNetAddrInfo::LocInfo &  loc)
inline

References Addr.

XrdProtocol* XrdLink::setProtocol ( XrdProtocol pp)
void XrdLink::setRef ( int  cnt)
static int XrdLink::Setup ( int  maxfd,
int  idlewait 
)
static
static int XrdLink::Stats ( char *  buff,
int  blen,
int  do_sync = 0 
)
static
void XrdLink::syncStats ( int *  ctime = 0)
int XrdLink::Terminate ( const XrdLink owner,
int  fdnum,
unsigned int  inst 
)
time_t XrdLink::timeCon ( )
inline

References conTime.

int XrdLink::UseCnt ( )
inline

References InUse.

Friends And Related Function Documentation

friend class XrdLinkScan
friend
friend class XrdPoll
friend
friend class XrdPollDev
friend
friend class XrdPollE
friend
friend class XrdPollPoll
friend

Member Data Documentation

XrdNetAddr XrdLink::Addr
private

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

long long XrdLink::BytesIn
private

Referenced by getIOStats().

long long XrdLink::BytesInTot
private

Referenced by getIOStats().

long long XrdLink::BytesOut
private

Referenced by getIOStats().

long long XrdLink::BytesOutTot
private

Referenced by getIOStats().

time_t XrdLink::conTime
private

Referenced by timeCon().

int XrdLink::devNull
staticprivate
int XrdLink::doPost
private
char* XrdLink::Etext
private

Referenced by isFlawed().

int XrdLink::FD
private

Referenced by FDnum(), and isInstance().

int XrdLink::HNlen
private
char* XrdLink::HostName
private

Referenced by Host().

char* XrdLink::ID
char XrdLink::inQ
private
unsigned int XrdLink::Instance
private

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

int XrdLink::InUse
private

Referenced by getIOStats(), and UseCnt().

XrdSysSemaphore XrdLink::IOSemaphore
private
char XrdLink::isBridged
private

Referenced by armBridge(), and hasBridge().

char XrdLink::isEnabled
private
char XrdLink::isIdle
private
char XrdLink::KeepFD
private
char XrdLink::KillCnt
private
XrdSysCondVar* XrdLink::KillcvP
private
const char XrdLink::KillMax = 60
staticprivate
const char XrdLink::KillMsk = 0x7f
staticprivate
short XrdLink::killWait
staticprivate
const char XrdLink::KillXwt = 0x80
staticprivate
unsigned int XrdLink::LinkAlloc
staticprivate
char* XrdLink::LinkBat
staticprivate

Referenced by fd2link().

long long XrdLink::LinkBytesIn
staticprivate
long long XrdLink::LinkBytesOut
staticprivate
long long XrdLink::LinkConTime
staticprivate
int XrdLink::LinkCount
staticprivate
int XrdLink::LinkCountMax
staticprivate
long long XrdLink::LinkCountTot
staticprivate
int XrdLink::LinkSfIntr
staticprivate
int XrdLink::LinkStalls
staticprivate
XrdLink** XrdLink::LinkTab
staticprivate

Referenced by fd2link().

int XrdLink::LinkTimeOuts
staticprivate
char XrdLink::Lname[232]
private

Referenced by Name().

char XrdLink::LockReads
private
int XrdLink::LTLast
staticprivate

Referenced by fd2link().

XrdSysMutex XrdLink::LTMutex
staticprivate
XrdLink* XrdLink::Next
private
XrdSysMutex XrdLink::opMutex
private

Referenced by Hold().

struct pollfd* XrdLink::PollEnt
private
XrdPoll* XrdLink::Poller
private
XrdProtocol* XrdLink::ProtoAlt
private
XrdProtocol* XrdLink::Protocol
private

Referenced by getProtocol().

XrdSysMutex XrdLink::rdMutex
private
int XrdLink::SfIntr
private
int XrdLink::sfOK
static
int XrdLink::stallCnt
private

Referenced by getIOStats().

int XrdLink::stallCntTot
private

Referenced by getIOStats().

XrdSysMutex XrdLink::statsMutex
staticprivate
int XrdLink::tardyCnt
private

Referenced by getIOStats().

int XrdLink::tardyCntTot
private

Referenced by getIOStats().

pthread_t XrdLink::TID
private
const char* XrdLink::TraceID
staticprivate
char XrdLink::Uname[24]
private
short XrdLink::waitKill
staticprivate
XrdSysMutex XrdLink::wrMutex
private
XrdSysError* XrdLink::XrdLog
staticprivate

Referenced by Init().

XrdInet* XrdLink::XrdNetTCP
staticprivate

Referenced by Init().

XrdScheduler* XrdLink::XrdSched
staticprivate

Referenced by Init().

XrdOucTrace* XrdLink::XrdTrace
staticprivate

Referenced by Init().


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