XrdNetLink Class Reference

#include <XrdNetLink.hh>

List of all members.

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 XrdNetLinkAlloc (XrdSysError *erp, XrdNet *Net, XrdNetPeer &Peer, XrdNetBufferQ *bq, int opts=0)

Public Attributes

XrdOucQSItem< XrdNetLinkLinkLink

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
XrdNetBufferQBuffQ
int FD
int noclose
int isReset
sockaddr InetAddr
char * Lname
char * Sname
XrdNetBufferrecvbuff
XrdNetBuffersendbuff
XrdOucStreamStream
XrdOucTokenizerBucket
XrdSysErroreDest

Static Private Attributes

static XrdSysMutex LinkList
static XrdOucStack< XrdNetLinkLinkStack
static int size
static int maxlink
static int numlink
static int devNull


Detailed Description

Definition at line 44 of file XrdNetLink.hh.


Constructor & Destructor Documentation

XrdNetLink::XrdNetLink ( XrdSysError erp,
XrdNetBufferQ bq 
) [inline]

Definition at line 153 of file XrdNetLink.hh.

References Bucket, BuffQ, eDest, FD, Lname, recvbuff, sendbuff, Sname, and Stream.

Referenced by Alloc().

XrdNetLink::~XrdNetLink (  )  [inline]

Definition at line 157 of file XrdNetLink.hh.

References Close().


Member Function Documentation

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]

Definition at line 61 of file XrdNetLink.hh.

References FD.

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]

Definition at line 75 of file XrdNetLink.hh.

References FD, and Stream.

int XrdNetLink::LastError (  ) 

Definition at line 173 of file XrdNetLink.cc.

References XrdOucStream::LastError(), and Stream.

unsigned int XrdNetLink::Addr (  )  [inline]

Definition at line 83 of file XrdNetLink.hh.

References InetAddr, and XrdNetDNS::IPAddr().

const char* XrdNetLink::Moniker (  )  [inline]

Definition at line 87 of file XrdNetLink.hh.

References Sname.

const char* XrdNetLink::Name (  )  [inline]

Definition at line 91 of file XrdNetLink.hh.

References Lname.

const char* XrdNetLink::Nick (  )  [inline]

Definition at line 95 of file XrdNetLink.hh.

References Sname.

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().


Member Data Documentation

XrdOucQSItem<XrdNetLink> XrdNetLink::LinkLink

Definition at line 48 of file XrdNetLink.hh.

Referenced by Recycle().

XrdSysMutex XrdNetLink::rdMutex [private]

Definition at line 164 of file XrdNetLink.hh.

Referenced by Close(), and Recv().

XrdSysMutex XrdNetLink::wrMutex [private]

Definition at line 165 of file XrdNetLink.hh.

Referenced by Close(), retErr(), and Send().

XrdNetBufferQ* XrdNetLink::BuffQ [private]

Definition at line 166 of file XrdNetLink.hh.

Referenced by Alloc(), Send(), and XrdNetLink().

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]

Definition at line 168 of file XrdNetLink.hh.

Referenced by Alloc(), and Close().

int XrdNetLink::isReset [private]

Definition at line 169 of file XrdNetLink.hh.

Referenced by Alloc(), and Close().

struct sockaddr XrdNetLink::InetAddr [private]

Definition at line 170 of file XrdNetLink.hh.

Referenced by Addr(), Alloc(), and Send().

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]

Definition at line 179 of file XrdNetLink.hh.

Referenced by Alloc(), Recycle(), and Set().

XrdOucStack< XrdNetLink > XrdNetLink::LinkStack [static, private]

Definition at line 180 of file XrdNetLink.hh.

Referenced by Alloc(), and Recycle().

int XrdNetLink::size [static, private]

Definition at line 181 of file XrdNetLink.hh.

int XrdNetLink::maxlink [static, private]

Definition at line 182 of file XrdNetLink.hh.

Referenced by Recycle(), and Set().

int XrdNetLink::numlink [static, private]

Definition at line 183 of file XrdNetLink.hh.

Referenced by Alloc(), and Recycle().

int XrdNetLink::devNull [static, private]

Definition at line 184 of file XrdNetLink.hh.

Referenced by Close().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:50:36 2011 for ROOT_528-00b_version by  doxygen 1.5.1