#include <XrdLinkCtl.hh>
Public Member Functions | |
| XrdLinkCtl () | |
| Constructor. | |
Static Public Member Functions | |
| static XrdLink * | Alloc (XrdNetAddr &peer, int opts=0) |
| static XrdLink * | fd2link (int fd) |
| static XrdLink * | fd2link (int fd, unsigned int inst) |
| static XrdPollInfo * | fd2PollInfo (int fd) |
| static XrdLink * | Find (int &curr, XrdLinkMatch *who=0) |
| static int | getName (int &curr, char *bname, int blen, XrdLinkMatch *who=0) |
| static void | idleScan () |
| Look for idle links and close hem down. | |
| static bool | RegisterCloseRequestCb (XrdLink *lp, XrdProtocol *pp, bool(*cb)(void *), void *cbarg) |
| static void | setKWT (int wkSec, int kwSec) |
| static int | Setup (int maxfds, int idlewt) |
| static void | SyncAll () |
| Synchronize statustics for ll links. | |
| static void | Unhook (int fd) |
| Unhook a link from the active table of links. | |
Static Public Attributes | |
| static short | killWait = 3 |
| Link destruction control constants. | |
| static short | waitKill = 4 |
Additional Inherited Members | |
| Protected Types inherited from XrdLink | |
| typedef XrdOucSFVec | sfVec |
| Protected Member Functions inherited from XrdLinkXeq | |
| int | RecvIOV (const struct iovec *iov, int iocnt) |
| void | Reset () |
| int | sendData (const char *Buff, int Blen) |
| int | SendIOV (const struct iovec *iov, int iocnt, int bytes) |
| int | SFError (int rc) |
| int | TLS_Error (const char *act, XrdTls::RC rc) |
| bool | TLS_Write (const char *Buff, int Blen) |
| XrdLinkXeq () | |
| ~XrdLinkXeq () | |
| XrdNetAddrInfo * | AddrInfo () |
| int | Backlog () |
| int | Client (char *buff, int blen) |
| int | Close (bool defer=false) |
| void | DoIt () |
| int | getIOStats (long long &inbytes, long long &outbytes, int &numstall, int &numtardy) |
| XrdTlsPeerCerts * | getPeerCerts () |
| XrdProtocol * | getProtocol () |
| const char * | Name () const |
| const XrdNetAddr * | NetAddr () const |
| int | Peek (char *buff, int blen, int timeout=-1) |
| int | Recv (char *buff, int blen) |
| int | Recv (char *buff, int blen, int timeout) |
| int | Recv (const struct iovec *iov, int iocnt, int timeout) |
| int | RecvAll (char *buff, int blen, int timeout=-1) |
| bool | Register (const char *hName) |
| bool | RegisterCloseRequestCb (XrdProtocol *pp, bool(*cb)(void *), void *cbarg) |
| int | Send (const char *buff, int blen) |
| int | Send (const sfVec *sdP, int sdn) |
| int | Send (const struct iovec *iov, int iocnt, int bytes=0) |
| void | setID (const char *userid, int procid) |
| void | setLocation (XrdNetAddrInfo::LocInfo &loc) |
| bool | setNB () |
| void | setProtName (const char *name) |
| XrdProtocol * | setProtocol (XrdProtocol *pp, bool push) |
| bool | setTLS (bool enable, XrdTlsContext *ctx=0) |
| void | Shutdown (bool getLock) |
| void | syncStats (int *ctime=0) |
| int | TLS_Peek (char *Buff, int Blen, int timeout) |
| int | TLS_Recv (char *Buff, int Blen) |
| int | TLS_Recv (char *Buff, int Blen, int timeout, bool havelock=false) |
| int | TLS_Recv (const struct iovec *iov, int iocnt, int timeout) |
| int | TLS_RecvAll (char *Buff, int Blen, int timeout) |
| int | TLS_Send (const char *Buff, int Blen) |
| int | TLS_Send (const sfVec *sfP, int sfN) |
| int | TLS_Send (const struct iovec *iov, int iocnt, int bytes) |
| const char * | verTLS () |
| Protected Member Functions inherited from XrdLink | |
| ~XrdLink () | |
| void | ResetLink () |
| int | Wait4Data (int timeout) |
| XrdLink (XrdLinkXeq &lxq) | |
| bool | Activate () |
| XrdNetAddrInfo * | AddrInfo () |
| void | armBridge () |
| Mark this link as an in-memory communications bridge (internal use only). | |
| int | Backlog () |
| int | Client (char *buff, int blen) |
| int | Close (bool defer=false) |
| void | Enable () |
| Enable the link to field interrupts. | |
| int | FDnum () |
| int | getIOStats (long long &inbytes, long long &outbytes, int &numstall, int &numtardy) |
| XrdTlsPeerCerts * | getPeerCerts () |
| XrdProtocol * | getProtocol () |
| Obtain current protocol object pointer. | |
| bool | hasBridge () const |
| bool | hasTLS () const |
| void | Hold (bool lk) |
| const char * | Host () const |
| unsigned int | Inst () const |
| bool | isFlawed () const |
| bool | isInstance (unsigned int inst) const |
| const char * | Name () const |
| const XrdNetAddr * | NetAddr () const |
| int | Peek (char *buff, int blen, int timeout=-1) |
| int | Recv (char *buff, int blen) |
| int | Recv (char *buff, int blen, int timeout) |
| int | Recv (const struct iovec *iov, int iocnt, int timeout) |
| int | RecvAll (char *buff, int blen, int timeout=-1) |
| bool | Register (const char *hName) |
| int | Send (const char *buff, int blen) |
| int | Send (const sfVec *sdP, int sdn) |
| int | Send (const struct iovec *iov, int iocnt, int bytes=0) |
| void | Serialize () |
| Wait for all outstanding requests to be completed on the link. | |
| int | setEtext (const char *text) |
| void | setID (const char *userid, int procid) |
| void | setLocation (XrdNetAddrInfo::LocInfo &loc) |
| bool | setNB () |
| void | setProtName (const char *name) |
| XrdProtocol * | setProtocol (XrdProtocol *pp, bool runit=false, bool push=false) |
| void | setRef (int cnt) |
| bool | setTLS (bool enable, XrdTlsContext *ctx=0) |
| Enable or disable TLS on the link. | |
| void | Shutdown (bool getLock) |
| void | syncStats (int *ctime=0) |
| int | Terminate (const char *owner, int fdnum, unsigned int inst) |
| time_t | timeCon () const |
| Return the time the link was made active (i.e. time of connection). | |
| int | UseCnt () const |
| Return link's reference count. | |
| const char * | verTLS () |
| Protected Member Functions inherited from XrdJob | |
| XrdJob (const char *desc="") | |
| virtual | ~XrdJob () |
| Static Protected Member Functions inherited from XrdLinkXeq | |
| static int | getName (int &curr, char *bname, int blen, XrdLinkMatch *who=0) |
| static int | Stats (char *buff, int blen, bool do_sync=false) |
| Static Protected Member Functions inherited from XrdLink | |
| static XrdLink * | Find (int &curr, XrdLinkMatch *who=0) |
| static int | getName (int &curr, char *bname, int blen, XrdLinkMatch *who=0) |
| static int | Stats (char *buff, int blen, bool do_sync=0) |
| Protected Attributes inherited from XrdLinkXeq | |
| XrdNetAddr | Addr |
| long long | BytesIn |
| long long | BytesInTot |
| long long | BytesOut |
| long long | BytesOutTot |
| bool(* | CloseRequestCb )(void *) |
| void * | CloseRequestCbArg |
| int | HNlen |
| char | isIdle |
| bool | KeepFD |
| char | Lname [256] |
| bool | LockReads |
| XrdProtocol * | ProtoAlt |
| XrdProtocol * | Protocol |
| XrdSysMutex | rdMutex |
| XrdSendQ * | sendQ |
| int | SfIntr |
| int | stallCnt |
| int | stallCntTot |
| int | tardyCnt |
| int | tardyCntTot |
| XrdTlsSocket | tlsIO |
| char | Uname [24] |
| XrdSysMutex | wrMutex |
| XrdLinkInfo | LinkInfo |
| XrdPollInfo | PollInfo |
| Protected Attributes inherited from XrdLink | |
| char * | HostName |
| unsigned int | Instance |
| bool | isBridged |
| bool | isTLS |
| XrdLinkXeq & | linkXQ |
| void * | rsvd1 [3] |
| char | rsvd2 [2] |
| char * | ID |
| Pointer to the client's link identity. | |
| Protected Attributes inherited from XrdJob | |
| const char * | Comment |
| XrdJob * | NextJob |
| Static Protected Attributes inherited from XrdLinkXeq | |
| static long long | LinkBytesIn = 0 |
| static long long | LinkBytesOut = 0 |
| static long long | LinkConTime = 0 |
| static int | LinkCount = 0 |
| static int | LinkCountMax = 0 |
| static long long | LinkCountTot = 0 |
| static int | LinkSfIntr = 0 |
| static int | LinkStalls = 0 |
| static int | LinkTimeOuts = 0 |
| static XrdSysMutex | statsMutex |
| static const char * | TraceID = "LinkXeq" |
| Static Protected Attributes inherited from XrdLink | |
| static bool | sfOK = false |
Definition at line 42 of file XrdLinkCtl.hh.
|
inline |
Constructor.
Definition at line 206 of file XrdLinkCtl.hh.
Referenced by Alloc(), Find(), getName(), idleScan(), and Setup().
|
static |
Definition at line 109 of file XrdLinkCtl.cc.
References XrdLink::XrdLink(), XrdLinkCtl(), XrdLinkXeq::Addr, AtomicInc, XrdJob::Comment, XrdLinkInfo::FD, XrdPollInfo::FD, XrdNetAddrInfo::fmtAuto, XrdNetAddrInfo::Format(), XrdLinkXeq::HNlen, XrdLink::HostName, XrdLink::ID, XrdLink::Instance, XrdLinkXeq::KeepFD, XrdLinkXeq::LinkCount, XrdLinkXeq::LinkCountMax, XrdLinkXeq::LinkCountTot, XrdLinkXeq::LinkInfo, XrdLinkXeq::Lname, XrdSysMutex::Lock(), XrdLinkXeq::LockReads, XrdGlobal::Log, XrdNetAddrInfo::noPort, XrdNetAddrInfo::old6Map4, opts, XrdLinkXeq::PollInfo, XrdLinkXeq::Reset(), XrdNetAddrInfo::SockFD(), XrdLinkXeq::statsMutex, strlcpy(), XrdLinkXeq::Uname, XrdSysMutex::UnLock(), XRDLINK_NOCLOSE, XRDLINK_RDLOCK, and XrdGlobal::XrdNetTCP.
Referenced by XrdInet::Accept(), and XrdInet::Connect().
|
inlinestatic |
Translate a file descriptor number to the corresponding link object.
| fd | The file descriptor number. |
Definition at line 72 of file XrdLinkCtl.hh.
References XrdLink::XrdLink().
Referenced by XrdXrootdResponse::Send(), and XrdLink::Terminate().
|
inlinestatic |
Translate a file descriptor number and an instance to a link object.
| fd | The file descriptor number. |
| inst | The file descriptor number instance number. |
Definition at line 87 of file XrdLinkCtl.hh.
References XrdLink::XrdLink(), and XrdLink::Instance.
|
inlinestatic |
Translate a file descriptor number to the corresponding PollInfo object.
| fd | The file descriptor number. |
Definition at line 103 of file XrdLinkCtl.hh.
|
static |
Find the next link matching certain attributes.
| curr | Is an internal tracking value that allows repeated calls. It must be set to a value of 0 or less on the initial call and not touched therafter unless a null pointer is returned. |
| who | If the object use to check if the link matches the wanted criterea (typically, client name and host name). If the ppointer is nil, the next link is always returned. |
Definition at line 202 of file XrdLinkCtl.cc.
References XrdLink::XrdLink(), XrdLinkCtl(), XrdLinkXeq::HNlen, XrdLink::HostName, XrdLink::ID, XrdLink::Instance, XrdLinkXeq::Lname, XrdLinkMatch::Match(), and XrdLink::setRef().
Referenced by XrdLink::Find().
|
static |
Find the next client name matching certain attributes.
| curr | Is an internal tracking value that allows repeated calls. It must be set to a value of 0 or less on the initial call and not touched therafter unless zero is returned. |
| bname | Pointer to a buffer where the name is to be returned. |
| blen | The length of the buffer. |
| who | If the object use to check if the link matches the wanted criterea (typically, client name and host name). If the pointer is nil, a match always occurs. |
Definition at line 248 of file XrdLinkCtl.cc.
References XrdLinkCtl(), XrdLinkXeq::Client(), XrdLinkXeq::HNlen, XrdLink::HostName, XrdLink::ID, XrdLinkXeq::Lname, and XrdLinkMatch::Match().
Referenced by XrdLink::getName().
|
static |
Look for idle links and close hem down.
Definition at line 285 of file XrdLinkCtl.cc.
References XrdLinkCtl(), XrdPoll::Disable(), XrdLink::ID, XrdLinkInfo::InUse, XrdPollInfo::isEnabled, XrdLinkXeq::isIdle, XrdLinkXeq::LinkInfo, XrdSysMutex::Lock(), XrdGlobal::Log, XrdLinkInfo::opMutex, XrdPollInfo::Poller, XrdLinkXeq::PollInfo, TRACE, and XrdSysMutex::UnLock().
|
static |
Regitsers an optional callback to be called if the Link determines it should Close. In case the callback returns false the Link will not Close itself, the Link should be Closed by an external call to Close.
Definition at line 407 of file XrdLinkCtl.cc.
References XrdLink::XrdLink(), XrdLinkXeq::XrdLinkXeq(), and XrdLinkXeq::RegisterCloseRequestCb().
|
static |
Set kill constants.
| wkSec | Seconds to wait for kill to happed, |
| kwSec | The minimum number of seconds to wait after killing a connection for it to end. |
Definition at line 327 of file XrdLinkCtl.cc.
|
static |
Setup link processing.
| maxfds | The maximum number of connections to handle. |
| idlewt | The time interval to check for idle connections. |
Definition at line 337 of file XrdLinkCtl.cc.
References XrdJob::XrdJob(), XrdLinkCtl(), DEBUG, XrdGlobal::Log, XrdGlobal::Sched, and TRACE.
|
static |
Synchronize statustics for ll links.
Definition at line 374 of file XrdLinkCtl.cc.
Referenced by XrdLinkXeq::Stats().
|
static |
Unhook a link from the active table of links.
Definition at line 392 of file XrdLinkCtl.cc.
Referenced by XrdLinkXeq::Close().
|
static |
Link destruction control constants.
Definition at line 199 of file XrdLinkCtl.hh.
Referenced by setKWT(), and XrdLink::Terminate().
|
static |
Definition at line 200 of file XrdLinkCtl.hh.
Referenced by setKWT(), and XrdLink::Terminate().