xrootd
|
#include <XrdNetLink.hh>
Public Member Functions | |
int | Close (int defer=0) |
int | FDnum () |
char * | GetLine () |
char * | GetToken (char **rest) |
char * | GetToken (void) |
void | RetToken (void) |
int | isConnected (void) |
int | LastError () |
unsigned int | Addr () |
const char * | Moniker () |
const char * | Name () |
const char * | Nick () |
int | OK2Recv (int mills) |
void | Recycle () |
int | Send (const char *buff, int blen=0, int tmo=-1) |
int | Send (const char *dest, const char *buff, int blen=0, int tmo=-1) |
int | Send (const struct iovec iov[], int iovcnt, int tmo=-1) |
int | Send (const char *dest, const struct iovec iov[], int iovcnt, int tmo=-1) |
int | Send (const void *buff, int blen=0, int tmo=-1) |
int | Recv (char *buff, int blen) |
void | Set (int maxl) |
void | SetOpts (int opts) |
XrdNetLink (XrdSysError *erp, XrdNetBufferQ *bq) | |
~XrdNetLink () | |
Static Public Member Functions | |
static XrdNetLink * | Alloc (XrdSysError *erp, XrdNet *Net, XrdNetPeer &Peer, XrdNetBufferQ *bq, int opts=0) |
Public Attributes | |
XrdOucQSItem< XrdNetLink > | LinkLink |
Private Member Functions | |
int | OK2Send (int timeout=0, const char *dest=0) |
int | retErr (int ecode, const char *dest=0) |
Private Attributes | |
XrdSysMutex | rdMutex |
XrdSysMutex | wrMutex |
XrdNetBufferQ * | BuffQ |
int | FD |
int | noclose |
int | isReset |
struct sockaddr | InetAddr |
char * | Lname |
char * | Sname |
XrdNetBuffer * | recvbuff |
XrdNetBuffer * | sendbuff |
XrdOucStream * | Stream |
XrdOucTokenizer * | Bucket |
XrdSysError * | eDest |
Static Private Attributes | |
static XrdSysMutex | LinkList |
static XrdOucStack< XrdNetLink > | LinkStack |
static int | size |
static int | maxlink = 16 |
static int | numlink = 0 |
static int | devNull = open("/dev/null", O_RDONLY) |
XrdNetLink::XrdNetLink | ( | XrdSysError * | erp, |
XrdNetBufferQ * | bq | ||
) | [inline] |
XrdNetLink::~XrdNetLink | ( | ) | [inline] |
References Close().
unsigned int XrdNetLink::Addr | ( | ) | [inline] |
References InetAddr, and XrdNetDNS::IPAddr().
XrdNetLink * XrdNetLink::Alloc | ( | XrdSysError * | erp, |
XrdNet * | Net, | ||
XrdNetPeer & | Peer, | ||
XrdNetBufferQ * | bq, | ||
int | opts = 0 |
||
) | [static] |
References XrdOucStream::Attach(), Bucket, BuffQ, XrdNetBuffer::data, FD, XrdNetPeer::fd, XrdNetDNS::getHostName(), XrdNetPeer::InetAddr, InetAddr, XrdNetPeer::InetBuff, XrdNetPeer::InetName, isReset, LinkList, LinkStack, Lname, XrdSysMutex::Lock(), noclose, numlink, XrdOucStack< T >::Pop(), recvbuff, Recycle(), XrdNetBuffer::Recycle(), sendbuff, Sname, Stream, XrdNet::Trim(), XrdSysMutex::UnLock(), XrdNetLink(), XRDNETLINK_NOCLOSE, and XRDNETLINK_NOSTREAM.
Referenced by XrdNetWork::Accept(), XrdNetWork::Connect(), and XrdNetWork::Relay().
int XrdNetLink::Close | ( | int | defer = 0 | ) |
References Bucket, close, XrdOucStream::Detach(), devNull, FD, isReset, Lname, XrdSysMutex::Lock(), noclose, rdMutex, recvbuff, XrdNetBuffer::Recycle(), sendbuff, Stream, XrdSysMutex::UnLock(), and wrMutex.
Referenced by Recycle(), and ~XrdNetLink().
int XrdNetLink::FDnum | ( | ) | [inline] |
References FD.
char * XrdNetLink::GetLine | ( | ) |
References Bucket, XrdNetBuffer::data, XrdNetBuffer::dlen, XrdOucTokenizer::GetLine(), XrdOucStream::GetLine(), recvbuff, and Stream.
char * XrdNetLink::GetToken | ( | char ** | rest | ) |
References Bucket, XrdOucTokenizer::GetToken(), XrdOucStream::GetToken(), and Stream.
char * XrdNetLink::GetToken | ( | void | ) |
References Bucket, XrdOucTokenizer::GetToken(), XrdOucStream::GetToken(), and Stream.
int XrdNetLink::LastError | ( | ) |
References XrdOucStream::LastError(), and Stream.
const char* XrdNetLink::Moniker | ( | ) | [inline] |
References Sname.
const char* XrdNetLink::Name | ( | ) | [inline] |
References Lname.
const char* XrdNetLink::Nick | ( | ) | [inline] |
References Sname.
int XrdNetLink::OK2Recv | ( | int | mills | ) |
References FD, poll(), POLLIN, POLLRDNORM, and pollfd::revents.
int XrdNetLink::OK2Send | ( | int | timeout = 0 , |
const char * | dest = 0 |
||
) | [private] |
References eDest, XrdSysError::Emsg(), FD, Lname, poll(), POLLOUT, POLLWRNORM, and pollfd::revents.
Referenced by Send().
int XrdNetLink::Recv | ( | char * | buff, |
int | blen | ||
) |
References eDest, XrdSysError::Emsg(), FD, Lname, XrdSysMutex::Lock(), rdMutex, read(), ssize_t, and XrdSysMutex::UnLock().
void XrdNetLink::Recycle | ( | void | ) |
References Close(), LinkLink, LinkList, LinkStack, XrdSysMutex::Lock(), maxlink, numlink, XrdOucStack< T >::Push(), and XrdSysMutex::UnLock().
Referenced by Alloc().
int XrdNetLink::retErr | ( | int | ecode, |
const char * | dest = 0 |
||
) | [private] |
References eDest, XrdSysError::Emsg(), EWOULDBLOCK, Lname, XrdSysMutex::UnLock(), and wrMutex.
Referenced by Send().
void XrdNetLink::RetToken | ( | void | ) |
References Bucket, XrdOucTokenizer::RetToken(), XrdOucStream::RetToken(), and Stream.
int XrdNetLink::Send | ( | const struct iovec | iov[], |
int | iovcnt, | ||
int | tmo = -1 |
||
) |
int XrdNetLink::Send | ( | const char * | dest, |
const struct iovec | iov[], | ||
int | iovcnt, | ||
int | tmo = -1 |
||
) |
int XrdNetLink::Send | ( | const char * | buff, |
int | blen = 0 , |
||
int | tmo = -1 |
||
) |
int XrdNetLink::Send | ( | const void * | buff, |
int | blen = 0 , |
||
int | tmo = -1 |
||
) |
References FD, InetAddr, XrdSysMutex::Lock(), OK2Send(), retErr(), Sokdata_t, Stream, XrdSysMutex::UnLock(), write(), and wrMutex.
int XrdNetLink::Send | ( | const char * | dest, |
const char * | buff, | ||
int | blen = 0 , |
||
int | tmo = -1 |
||
) |
References eDest, XrdSysError::Emsg(), FD, XrdNetDNS::Host2Dest(), IOV_INIT, XrdSysMutex::Lock(), OK2Send(), retErr(), Send(), Sokdata_t, Stream, XrdSysMutex::UnLock(), and wrMutex.
void XrdNetLink::Set | ( | int | maxl | ) |
References LinkList, XrdSysMutex::Lock(), maxlink, and XrdSysMutex::UnLock().
void XrdNetLink::SetOpts | ( | int | opts | ) |
References F_SETFL, fcntl(), FD, O_NONBLOCK, and XRDNETLINK_NOBLOCK.
XrdOucTokenizer* XrdNetLink::Bucket [private] |
Referenced by Alloc(), Close(), GetLine(), GetToken(), RetToken(), and XrdNetLink().
XrdNetBufferQ* XrdNetLink::BuffQ [private] |
Referenced by Alloc(), Send(), and XrdNetLink().
int XrdNetLink::devNull = open("/dev/null", O_RDONLY) [static, private] |
Referenced by Close().
XrdSysError* XrdNetLink::eDest [private] |
Referenced by OK2Send(), Recv(), retErr(), Send(), and XrdNetLink().
int XrdNetLink::FD [private] |
Referenced by Alloc(), Close(), FDnum(), isConnected(), OK2Recv(), OK2Send(), Recv(), Send(), SetOpts(), and XrdNetLink().
struct sockaddr XrdNetLink::InetAddr [private] |
int XrdNetLink::isReset [private] |
Referenced by Recycle().
XrdSysMutex XrdNetLink::LinkList [static, private] |
XrdOucStack< XrdNetLink > XrdNetLink::LinkStack [static, private] |
char* XrdNetLink::Lname [private] |
int XrdNetLink::maxlink = 16 [static, private] |
int XrdNetLink::noclose [private] |
int XrdNetLink::numlink = 0 [static, private] |
XrdSysMutex XrdNetLink::rdMutex [private] |
XrdNetBuffer* XrdNetLink::recvbuff [private] |
Referenced by Alloc(), Close(), GetLine(), and XrdNetLink().
XrdNetBuffer* XrdNetLink::sendbuff [private] |
Referenced by Alloc(), Close(), Send(), and XrdNetLink().
int XrdNetLink::size [static, private] |
char* XrdNetLink::Sname [private] |
Referenced by Alloc(), Moniker(), Nick(), and XrdNetLink().
XrdOucStream* XrdNetLink::Stream [private] |
Referenced by Alloc(), Close(), GetLine(), GetToken(), isConnected(), LastError(), RetToken(), Send(), and XrdNetLink().
XrdSysMutex XrdNetLink::wrMutex [private] |