xrootd
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XrdNetMsg Class Reference

#include <XrdNetMsg.hh>

Collaboration diagram for XrdNetMsg:
Collaboration graph
[legend]

Public Member Functions

int Send (const char *buff, int blen=0, const char *dest=0, int tmo=-1)
 
int Send (const char *dest, const XrdNetSockAddr &netSA, const char *buff, int blen=0, int tmo=-1)
 
int Send (const struct iovec iov[], int iovcnt, const char *dest=0, int tmo=-1)
 
 XrdNetMsg (XrdSysError *erp, const char *dest=0, bool *aOK=0)
 
 ~XrdNetMsg ()
 Destructor.
 

Protected Member Functions

int OK2Send (int timeout, const char *dest)
 
int retErr (int ecode, const char *theDest)
 
int retErr (int ecode, XrdNetAddr *theDest)
 

Protected Attributes

XrdSysErroreDest
 
XrdNetAddr dfltDest
 
XrdNetAddr specDest
 
int destOK
 
int FD
 

Constructor & Destructor Documentation

◆ XrdNetMsg()

XrdNetMsg::XrdNetMsg ( XrdSysError erp,
const char *  dest = 0,
bool *  aOK = 0 
)

Constructor

Parameters
erpThe error message object for routing error messages.
aOKIf supplied, set to true upon success; false otherwise.
destThe endpint name which can be host:port or a named socket. This becomes the default endpoint. Any specified endpoint to send must be in the same family (e.g. UNIX). If not specified, then an endpoint must always be specified with send and is restricted to be in the INET family.

◆ ~XrdNetMsg()

XrdNetMsg::~XrdNetMsg ( )
inline

Destructor.

References close, and FD.

Member Function Documentation

◆ OK2Send()

int XrdNetMsg::OK2Send ( int  timeout,
const char *  dest 
)
protected

◆ retErr() [1/2]

int XrdNetMsg::retErr ( int  ecode,
const char *  theDest 
)
protected

◆ retErr() [2/2]

int XrdNetMsg::retErr ( int  ecode,
XrdNetAddr theDest 
)
protected

◆ Send() [1/3]

int XrdNetMsg::Send ( const char *  buff,
int  blen = 0,
const char *  dest = 0,
int  tmo = -1 
)

Send a UDP message to an endpoint.

Parameters
buffThe data to send.
blenLength of the data in buff. If not specified, the length is computed as strlen(buff).
destThe endpint name which can be host:port or a named socket. If dest is zero, uses dest specified in the constructor.
tmomaximum seconds to wait for a idle socket. When negative, the default, no time limit applies.
Returns
<0 Message not sent due to error.
=0 Message send (well as defined by UDP)
>0 Message not sent, timeout occurred.

◆ Send() [2/3]

int XrdNetMsg::Send ( const char *  dest,
const XrdNetSockAddr netSA,
const char *  buff,
int  blen = 0,
int  tmo = -1 
)

Send a UDP message to an endpoint.

Parameters
buffThe data to send.
blenLength of the data in buff. If not specified, the length is computed as strlen(buff).
destThe endpoint in the form as in "host:port".
netSAThe endpoint address. This overrides the constructor.
tmomaximum seconds to wait for a idle socket. When negative, the default, no time limit applies.
Returns
<0 Message not sent due to error.
=0 Message send (well as defined by UDP)
>0 Message not sent, timeout occurred.

◆ Send() [3/3]

int XrdNetMsg::Send ( const struct iovec  iov[],
int  iovcnt,
const char *  dest = 0,
int  tmo = -1 
)

Send a UDP message to an endpoint using an I/O vector.

Parameters
iovThe vector of data to send. Total amount be <= 4096 bytes.
iovcntThe number of elements in the vector.
destThe endpint name which can be host:port or a named socket. If dest is zero, uses dest specified in the constructor.
tmomaximum seconds to wait for a idle socket. When negative, the default, no time limit applies.
Returns
<0 Message not sent due to error.
=0 Message send (well as defined by UDP)
>0 Message not sent, timeout occurred.

Member Data Documentation

◆ destOK

int XrdNetMsg::destOK
protected

◆ dfltDest

XrdNetAddr XrdNetMsg::dfltDest
protected

◆ eDest

XrdSysError* XrdNetMsg::eDest
protected

◆ FD

int XrdNetMsg::FD
protected

Referenced by ~XrdNetMsg().

◆ specDest

XrdNetAddr XrdNetMsg::specDest
protected

The documentation for this class was generated from the following file: