#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 |
| 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 |
| static int | numlink |
| static int | devNull |
Definition at line 44 of file XrdNetLink.hh.
| XrdNetLink::XrdNetLink | ( | XrdSysError * | erp, | |
| XrdNetBufferQ * | bq | |||
| ) | [inline] |
| XrdNetLink::~XrdNetLink | ( | ) | [inline] |
| XrdNetLink * XrdNetLink::Alloc | ( | XrdSysError * | erp, | |
| XrdNet * | Net, | |||
| XrdNetPeer & | Peer, | |||
| XrdNetBufferQ * | bq, | |||
| int | opts = 0 | |||
| ) | [static] |
Definition at line 49 of file XrdNetLink.cc.
References XrdOucStream::Attach(), Bucket, BuffQ, XrdNetBuffer::data, XrdNetPeer::fd, 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 |
) |
Definition at line 108 of file XrdNetLink.cc.
References Bucket, close, devNull, FD, free(), isReset, Lname, XrdSysMutex::Lock(), noclose, rdMutex, recvbuff, XrdNetBuffer::Recycle(), sendbuff, Stream, XrdSysMutex::UnLock(), and wrMutex.
Referenced by Recycle(), and ~XrdNetLink().
| int XrdNetLink::FDnum | ( | ) | [inline] |
| char * XrdNetLink::GetLine | ( | ) |
Definition at line 143 of file XrdNetLink.cc.
References Bucket, XrdNetBuffer::data, XrdNetBuffer::dlen, XrdOucTokenizer::GetLine(), XrdOucStream::GetLine(), recvbuff, and Stream.
| char * XrdNetLink::GetToken | ( | char ** | rest | ) |
Definition at line 155 of file XrdNetLink.cc.
References Bucket, XrdOucStream::GetToken(), XrdOucTokenizer::GetToken(), and Stream.
| char * XrdNetLink::GetToken | ( | void | ) |
Definition at line 162 of file XrdNetLink.cc.
References Bucket, XrdOucStream::GetToken(), XrdOucTokenizer::GetToken(), and Stream.
| void XrdNetLink::RetToken | ( | void | ) |
Definition at line 236 of file XrdNetLink.cc.
References Bucket, XrdOucStream::RetToken(), XrdOucTokenizer::RetToken(), and Stream.
| int XrdNetLink::isConnected | ( | void | ) | [inline] |
| int XrdNetLink::LastError | ( | ) |
| unsigned int XrdNetLink::Addr | ( | ) | [inline] |
| const char* XrdNetLink::Moniker | ( | ) | [inline] |
| const char* XrdNetLink::Name | ( | ) | [inline] |
| const char* XrdNetLink::Nick | ( | ) | [inline] |
| int XrdNetLink::OK2Recv | ( | int | mills | ) |
Definition at line 182 of file XrdNetLink.cc.
References FD, poll(), POLLIN, POLLRDNORM, and pollfd::revents.
| void XrdNetLink::Recycle | ( | ) |
Definition at line 196 of file XrdNetLink.cc.
References Close(), LinkLink, LinkList, LinkStack, XrdSysMutex::Lock(), maxlink, numlink, XrdOucStack< T >::Push(), and XrdSysMutex::UnLock().
Referenced by Alloc().
| int XrdNetLink::Send | ( | const char * | buff, | |
| int | blen = 0, |
|||
| int | tmo = -1 | |||
| ) |
Definition at line 246 of file XrdNetLink.cc.
References FD, InetAddr, IOV_INIT, XrdSysMutex::Lock(), OK2Send(), retErr(), Sokdata_t, Stream, XrdSysMutex::UnLock(), write, and wrMutex.
Referenced by Send().
| int XrdNetLink::Send | ( | const char * | dest, | |
| const char * | buff, | |||
| int | blen = 0, |
|||
| int | tmo = -1 | |||
| ) |
Definition at line 295 of file XrdNetLink.cc.
References eDest, XrdSysError::Emsg(), FD, XrdNetDNS::Host2Dest(), IOV_INIT, XrdSysMutex::Lock(), OK2Send(), retErr(), Send(), Sokdata_t, Stream, XrdSysMutex::UnLock(), and wrMutex.
| int XrdNetLink::Send | ( | const struct iovec | iov[], | |
| int | iovcnt, | |||
| int | tmo = -1 | |||
| ) |
Definition at line 331 of file XrdNetLink.cc.
References XrdNetBufferQ::Alloc(), BuffQ, XrdNetBuffer::BuffSize(), XrdNetBuffer::data, EMSGSIZE, FD, i, InetAddr, iovec::iov_base, iovec::iov_len, XrdSysMutex::Lock(), OK2Send(), retErr(), sendbuff, Sokdata_t, Stream, XrdSysMutex::UnLock(), writev, and wrMutex.
| int XrdNetLink::Send | ( | const char * | dest, | |
| const struct iovec | iov[], | |||
| int | iovcnt, | |||
| int | tmo = -1 | |||
| ) |
Definition at line 363 of file XrdNetLink.cc.
References XrdNetBufferQ::Alloc(), BuffQ, XrdNetBuffer::BuffSize(), XrdNetBuffer::data, eDest, XrdSysError::Emsg(), EMSGSIZE, FD, XrdNetDNS::Host2Dest(), i, iovec::iov_len, XrdSysMutex::Lock(), OK2Send(), retErr(), sendbuff, Sokdata_t, Stream, XrdSysMutex::UnLock(), and wrMutex.
| int XrdNetLink::Send | ( | const void * | buff, | |
| int | blen = 0, |
|||
| int | tmo = -1 | |||
| ) |
Definition at line 274 of file XrdNetLink.cc.
References FD, InetAddr, XrdSysMutex::Lock(), OK2Send(), retErr(), Sokdata_t, Stream, XrdSysMutex::UnLock(), write, and wrMutex.
| int XrdNetLink::Recv | ( | char * | buff, | |
| int | blen | |||
| ) |
Definition at line 217 of file XrdNetLink.cc.
References eDest, XrdSysError::Emsg(), FD, int, Lname, XrdSysMutex::Lock(), rdMutex, read, ssize_t, and XrdSysMutex::UnLock().
| void XrdNetLink::Set | ( | int | maxl | ) |
Definition at line 405 of file XrdNetLink.cc.
References LinkList, XrdSysMutex::Lock(), maxlink, and XrdSysMutex::UnLock().
| void XrdNetLink::SetOpts | ( | int | opts | ) |
Definition at line 420 of file XrdNetLink.cc.
References F_SETFL, fcntl(), FD, O_NONBLOCK, and XRDNETLINK_NOBLOCK.
| int XrdNetLink::OK2Send | ( | int | timeout = 0, |
|
| const char * | dest = 0 | |||
| ) | [private] |
Definition at line 435 of file XrdNetLink.cc.
References eDest, XrdSysError::Emsg(), FD, Lname, poll(), POLLOUT, POLLWRNORM, and pollfd::revents.
Referenced by Send().
| int XrdNetLink::retErr | ( | int | ecode, | |
| const char * | dest = 0 | |||
| ) | [private] |
Definition at line 454 of file XrdNetLink.cc.
References eDest, XrdSysError::Emsg(), EWOULDBLOCK, Lname, XrdSysMutex::UnLock(), and wrMutex.
Referenced by Send().
XrdSysMutex XrdNetLink::rdMutex [private] |
XrdSysMutex XrdNetLink::wrMutex [private] |
XrdNetBufferQ* XrdNetLink::BuffQ [private] |
int XrdNetLink::FD [private] |
Definition at line 167 of file XrdNetLink.hh.
Referenced by Alloc(), Close(), FDnum(), isConnected(), OK2Recv(), OK2Send(), Recv(), Send(), SetOpts(), and XrdNetLink().
int XrdNetLink::noclose [private] |
int XrdNetLink::isReset [private] |
struct sockaddr XrdNetLink::InetAddr [private] |
char* XrdNetLink::Lname [private] |
Definition at line 171 of file XrdNetLink.hh.
Referenced by Alloc(), Close(), Name(), OK2Send(), Recv(), retErr(), and XrdNetLink().
char* XrdNetLink::Sname [private] |
Definition at line 172 of file XrdNetLink.hh.
Referenced by Alloc(), Moniker(), Nick(), and XrdNetLink().
XrdNetBuffer* XrdNetLink::recvbuff [private] |
Definition at line 173 of file XrdNetLink.hh.
Referenced by Alloc(), Close(), GetLine(), and XrdNetLink().
XrdNetBuffer* XrdNetLink::sendbuff [private] |
Definition at line 174 of file XrdNetLink.hh.
Referenced by Alloc(), Close(), Send(), and XrdNetLink().
XrdOucStream* XrdNetLink::Stream [private] |
Definition at line 175 of file XrdNetLink.hh.
Referenced by Alloc(), Close(), GetLine(), GetToken(), isConnected(), LastError(), RetToken(), Send(), and XrdNetLink().
XrdOucTokenizer* XrdNetLink::Bucket [private] |
Definition at line 176 of file XrdNetLink.hh.
Referenced by Alloc(), Close(), GetLine(), GetToken(), RetToken(), and XrdNetLink().
XrdSysError* XrdNetLink::eDest [private] |
Definition at line 177 of file XrdNetLink.hh.
Referenced by OK2Send(), Recv(), retErr(), Send(), and XrdNetLink().
XrdSysMutex XrdNetLink::LinkList [static, private] |
XrdOucStack< XrdNetLink > XrdNetLink::LinkStack [static, private] |
int XrdNetLink::size [static, private] |
Definition at line 181 of file XrdNetLink.hh.
int XrdNetLink::maxlink [static, private] |
int XrdNetLink::numlink [static, private] |
int XrdNetLink::devNull [static, private] |
1.5.1