#include <XrdLinkXeq.hh>
Public Member Functions | |
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 () |
Obtain current protocol object pointer. | |
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 | RecvAll (char *buff, int blen, int timeout=-1) |
bool | Register (const char *hName) |
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 | setID (const char *userid, int procid) |
void | setLocation (XrdNetAddrInfo::LocInfo &loc) |
bool | setNB () |
XrdProtocol * | setProtocol (XrdProtocol *pp, bool push) |
void | setProtName (const char *name) |
bool | setTLS (bool enable, XrdTlsContext *ctx=0) |
Enable or disable TLS on the link. | |
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) |
int | TLS_RecvAll (char *Buff, int Blen, int timeout) |
int | TLS_Send (const char *Buff, int Blen) |
int | TLS_Send (const struct iovec *iov, int iocnt, int bytes) |
int | TLS_Send (const sfVec *sfP, int sfN) |
const char * | verTLS () |
XrdLinkXeq () | |
~XrdLinkXeq () | |
Static Public Member Functions | |
static int | getName (int &curr, char *bname, int blen, XrdLinkMatch *who=0) |
static int | Stats (char *buff, int blen, bool do_sync=false) |
Public Attributes | |
XrdLinkInfo | LinkInfo |
XrdPollInfo | PollInfo |
Protected Member Functions | |
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) |
Protected Attributes | |
long long | BytesIn |
long long | BytesInTot |
long long | BytesOut |
long long | BytesOutTot |
int | stallCnt |
int | stallCntTot |
int | tardyCnt |
int | tardyCntTot |
int | SfIntr |
XrdProtocol * | Protocol |
XrdProtocol * | ProtoAlt |
XrdTlsSocket | tlsIO |
XrdNetAddr | Addr |
XrdSysMutex | rdMutex |
XrdSysMutex | wrMutex |
XrdSendQ * | sendQ |
int | HNlen |
bool | LockReads |
bool | KeepFD |
char | isIdle |
char | Uname [24] |
char | Lname [256] |
Static Protected Attributes | |
static const char * | TraceID |
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 |
XrdLinkXeq::XrdLinkXeq | ( | ) |
XrdLinkXeq::~XrdLinkXeq | ( | ) | [inline] |
XrdNetAddrInfo* XrdLinkXeq::AddrInfo | ( | ) | [inline] |
int XrdLinkXeq::Backlog | ( | ) |
Obtain the number of queued async requests.
Reimplemented from XrdLink.
int XrdLinkXeq::Client | ( | char * | buff, | |
int | blen | |||
) |
Get a copy of the client's name as known by the link.
buff | Pointer to buffer to hold the name. | |
blen | Length of the buffer. |
Reimplemented from XrdLink.
int XrdLinkXeq::Close | ( | bool | defer = false |
) |
Close the link.
defer | If true, the link is made unaccessible but the link object not the file descriptor is released. |
Reimplemented from XrdLink.
void XrdLinkXeq::DoIt | ( | ) | [virtual] |
Reimplemented from XrdLink.
int XrdLinkXeq::getIOStats | ( | long long & | inbytes, | |
long long & | outbytes, | |||
int & | numstall, | |||
int & | numtardy | |||
) | [inline] |
Get I/O statistics.
inbytes | The number of bytes read. | |
outbytes | The number of bytes written. | |
numstall | The number of times the link was rescheduled due to unavailability. | |
numtardy | The number of times the link was delayed due to unavailability. |
Reimplemented from XrdLink.
References BytesIn, BytesInTot, BytesOut, BytesOutTot, XrdLinkInfo::InUse, LinkInfo, stallCnt, stallCntTot, tardyCnt, and tardyCntTot.
static int XrdLinkXeq::getName | ( | int & | curr, | |
char * | bname, | |||
int | blen, | |||
XrdLinkMatch * | who = 0 | |||
) | [static] |
Find the next client name matching certain attributes.
cur | 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. |
Reimplemented from XrdLink.
Reimplemented in XrdLinkCtl.
XrdTlsPeerCerts* XrdLinkXeq::getPeerCerts | ( | ) |
Get the x509 certificate information for this TLS enabled link.
Reimplemented from XrdLink.
XrdProtocol* XrdLinkXeq::getProtocol | ( | ) | [inline] |
const char* XrdLinkXeq::Name | ( | ) | const [inline] |
const XrdNetAddr* XrdLinkXeq::NetAddr | ( | ) | const [inline] |
int XrdLinkXeq::Peek | ( | char * | buff, | |
int | blen, | |||
int | timeout = -1 | |||
) |
Issue a socket peek() and return result (do not use for TLS connections).
buff | pointer to buffer to hold data. | |
blen | length of buffer. | |
timeout | milliseconds to wait for data. A negative value waits forever. |
Reimplemented from XrdLink.
int XrdLinkXeq::Recv | ( | char * | buff, | |
int | blen, | |||
int | timeout | |||
) |
Read data from a link. Note that this call either reads all the data wanted or no data if the passed timeout occurs before any data is present.
buff | pointer to buffer to hold data. | |
blen | length of buffer (implies the actual bytes wanted). | |
timeout | milliseconds to wait for data. A negative value waits forever. |
Reimplemented from XrdLink.
int XrdLinkXeq::Recv | ( | char * | buff, | |
int | blen | |||
) |
Read data from a link. Note that this call blocks until some data is available. Use Recv() with a timeout to avoid blocking.
buff | pointer to buffer to hold data. | |
blen | length of buffer (implies the maximum bytes wanted). |
Reimplemented from XrdLink.
int XrdLinkXeq::RecvAll | ( | char * | buff, | |
int | blen, | |||
int | timeout = -1 | |||
) |
Read data from a link. Note that this call reads as much data as it can or until the passed timeout has occurred.
buff | pointer to buffer to hold data. | |
blen | length of buffer (implies the maximum bytes wanted). | |
timeout | milliseconds to wait for data. A negative value waits forever. |
Reimplemented from XrdLink.
bool XrdLinkXeq::Register | ( | const char * | hName | ) |
Register a host name with this IP address. This is not MT-safe!
hName | -> to a true host name which should be fully qualified. One of the IP addresses registered to this name must match the IP address associated with this object. |
Reimplemented from XrdLink.
void XrdLinkXeq::Reset | ( | ) | [protected] |
int XrdLinkXeq::Send | ( | const struct iovec * | iov, | |
int | iocnt, | |||
int | bytes = 0 | |||
) |
Send data on a link. This calls may block unless the socket was marked nonblocking. If a block would occur, the data is copied for later sending.
iov | pointer to the message vector. | |
iocnt | number of iov elements in the vector. | |
bytes | the sum of the sizes in the vector. |
Reimplemented from XrdLink.
int XrdLinkXeq::Send | ( | const char * | buff, | |
int | blen | |||
) |
Send data on a link. This calls may block unless the socket was marked nonblocking. If a block would occur, the data is copied for later sending.
buff | pointer to buffer to send. | |
blen | length of buffer. |
Reimplemented from XrdLink.
int XrdLinkXeq::sendData | ( | const char * | Buff, | |
int | Blen | |||
) | [protected] |
int XrdLinkXeq::SendIOV | ( | const struct iovec * | iov, | |
int | iocnt, | |||
int | bytes | |||
) | [protected] |
void XrdLinkXeq::setID | ( | const char * | userid, | |
int | procid | |||
) |
Set the client's link identity.
userid | pointer to the client's username. | |
procid | the client's process id (i.e. pid). |
Reimplemented from XrdLink.
void XrdLinkXeq::setLocation | ( | XrdNetAddrInfo::LocInfo & | loc | ) | [inline] |
Set the client's location.
loc | reference to the location information. |
Reimplemented from XrdLink.
References Addr, and XrdNetAddr::SetLocation().
bool XrdLinkXeq::setNB | ( | ) |
Set the link to be non-blocking.
Reimplemented from XrdLink.
void XrdLinkXeq::setProtName | ( | const char * | name | ) |
Set the link's protocol name.
name | name of he protocol being used. The storage must be valid for the duration of the program. |
Reimplemented from XrdLink.
XrdProtocol* XrdLinkXeq::setProtocol | ( | XrdProtocol * | pp, | |
bool | push | |||
) |
bool XrdLinkXeq::setTLS | ( | bool | enable, | |
XrdTlsContext * | ctx = 0 | |||
) |
Enable or disable TLS on the link.
enable | if true, TLS is enabled if not already enabled. Otherwise, TLS is disabled and the TLS logical connection torn down. statistics may be contradictory as they are collected async. | |
ctx | The context to use when enabling TLS. When nil, the default context is used. |
Reimplemented from XrdLink.
int XrdLinkXeq::SFError | ( | int | rc | ) | [protected] |
void XrdLinkXeq::Shutdown | ( | bool | getLock | ) |
Shutdown the link but otherwise keep it intact.
getlock | if true, the operation is performed under a lock. |
Reimplemented from XrdLink.
static int XrdLinkXeq::Stats | ( | char * | buff, | |
int | blen, | |||
bool | do_sync = false | |||
) | [static] |
Obtain link statistics.
buff | pointer to the buffer for the xml statistics. | |
blen | length of the buffer. | |
do_sync | if true, the statistics self-consistent. Otherwise, the statistics may be contradictory as they are collected async. |
Reimplemented from XrdLink.
void XrdLinkXeq::syncStats | ( | int * | ctime = 0 |
) |
Add all local statistics to the global counters.
ctime | if not nil, return the total connect time in seconds. |
Reimplemented from XrdLink.
int XrdLinkXeq::TLS_Error | ( | const char * | act, | |
XrdTls::RC | rc | |||
) | [protected] |
int XrdLinkXeq::TLS_Peek | ( | char * | Buff, | |
int | Blen, | |||
int | timeout | |||
) |
int XrdLinkXeq::TLS_Recv | ( | char * | Buff, | |
int | Blen, | |||
int | timeout | |||
) |
int XrdLinkXeq::TLS_Recv | ( | char * | Buff, | |
int | Blen | |||
) |
int XrdLinkXeq::TLS_RecvAll | ( | char * | Buff, | |
int | Blen, | |||
int | timeout | |||
) |
int XrdLinkXeq::TLS_Send | ( | const sfVec * | sfP, | |
int | sfN | |||
) |
int XrdLinkXeq::TLS_Send | ( | const struct iovec * | iov, | |
int | iocnt, | |||
int | bytes | |||
) |
int XrdLinkXeq::TLS_Send | ( | const char * | Buff, | |
int | Blen | |||
) |
bool XrdLinkXeq::TLS_Write | ( | const char * | Buff, | |
int | Blen | |||
) | [protected] |
const char* XrdLinkXeq::verTLS | ( | ) |
Return TLS protocol version being used.
Reimplemented from XrdLink.
XrdNetAddr XrdLinkXeq::Addr [protected] |
Referenced by AddrInfo(), NetAddr(), and setLocation().
long long XrdLinkXeq::BytesIn [protected] |
Referenced by getIOStats().
long long XrdLinkXeq::BytesInTot [protected] |
Referenced by getIOStats().
long long XrdLinkXeq::BytesOut [protected] |
Referenced by getIOStats().
long long XrdLinkXeq::BytesOutTot [protected] |
Referenced by getIOStats().
int XrdLinkXeq::HNlen [protected] |
char XrdLinkXeq::isIdle [protected] |
bool XrdLinkXeq::KeepFD [protected] |
long long XrdLinkXeq::LinkBytesIn [static, protected] |
long long XrdLinkXeq::LinkBytesOut [static, protected] |
long long XrdLinkXeq::LinkConTime [static, protected] |
int XrdLinkXeq::LinkCount [static, protected] |
int XrdLinkXeq::LinkCountMax [static, protected] |
long long XrdLinkXeq::LinkCountTot [static, protected] |
Referenced by getIOStats().
int XrdLinkXeq::LinkSfIntr [static, protected] |
int XrdLinkXeq::LinkStalls [static, protected] |
int XrdLinkXeq::LinkTimeOuts [static, protected] |
char XrdLinkXeq::Lname[256] [protected] |
Referenced by Name().
bool XrdLinkXeq::LockReads [protected] |
Referenced by XrdLinkCtl::fd2PollInfo().
XrdProtocol* XrdLinkXeq::ProtoAlt [protected] |
XrdProtocol* XrdLinkXeq::Protocol [protected] |
Referenced by getProtocol().
XrdSysMutex XrdLinkXeq::rdMutex [protected] |
XrdSendQ* XrdLinkXeq::sendQ [protected] |
int XrdLinkXeq::SfIntr [protected] |
int XrdLinkXeq::stallCnt [protected] |
Referenced by getIOStats().
int XrdLinkXeq::stallCntTot [protected] |
Referenced by getIOStats().
XrdSysMutex XrdLinkXeq::statsMutex [static, protected] |
int XrdLinkXeq::tardyCnt [protected] |
Referenced by getIOStats().
int XrdLinkXeq::tardyCntTot [protected] |
Referenced by getIOStats().
XrdTlsSocket XrdLinkXeq::tlsIO [protected] |
const char* XrdLinkXeq::TraceID [static, protected] |
Reimplemented in XrdLinkCtl.
char XrdLinkXeq::Uname[24] [protected] |
XrdSysMutex XrdLinkXeq::wrMutex [protected] |