A network socket.
More...
#include <XrdClSocket.hh>
|
| | Socket (int socket=-1, SocketStatus status=Disconnected) |
| |
| | ~Socket () |
| | Desctuctor. More...
|
| |
| XRootDStatus | Initialize (int family=AF_INET) |
| | Initialize the socket. More...
|
| |
| XRootDStatus | SetFlags (int flags) |
| | Set the socket flags (man fcntl) More...
|
| |
| XRootDStatus | GetFlags (int &flags) |
| | Get the socket flags (man fcntl) More...
|
| |
| XRootDStatus | GetSockOpt (int level, int optname, void *optval, socklen_t *optlen) |
| | Get socket options. More...
|
| |
| XRootDStatus | SetSockOpt (int level, int optname, const void *optval, socklen_t optlen) |
| | Set socket options. More...
|
| |
| XRootDStatus | Connect (const std::string &host, uint16_t port, uint16_t timout=10) |
| |
| XRootDStatus | ConnectToAddress (const XrdNetAddr &addr, uint16_t timout=10) |
| |
| void | Close () |
| | Disconnect. More...
|
| |
| SocketStatus | GetStatus () const |
| | Get the socket status. More...
|
| |
| void | SetStatus (SocketStatus status) |
| | Set socket status - do not use unless you know what you're doing. More...
|
| |
| XRootDStatus | ReadRaw (void *buffer, uint32_t size, int32_t timeout, uint32_t &bytesRead) |
| |
| XRootDStatus | WriteRaw (void *buffer, uint32_t size, int32_t timeout, uint32_t &bytesWritten) |
| |
| XRootDStatus | Send (const char *buffer, size_t size, int &bytesWritten) |
| |
| XRootDStatus | Read (char *buffer, size_t size, int &bytesRead) |
| |
| int | GetFD () |
| | Get the file descriptor. More...
|
| |
| std::string | GetSockName () const |
| | Get the name of the socket. More...
|
| |
| std::string | GetPeerName () const |
| | Get the name of the remote peer. More...
|
| |
| std::string | GetName () const |
| | Get the string representation of the socket. More...
|
| |
| const XrdNetAddr & | GetServerAddress () const |
| | Get the server address. More...
|
| |
| void | SetChannelID (AnyObject *channelID) |
| |
| const AnyObject * | GetChannelID () const |
| |
| XRootDStatus | Cork () |
| |
| XRootDStatus | Uncork () |
| |
| XRootDStatus | Flash () |
| |
| bool | IsCorked () const |
| |
| uint8_t | MapEvent (uint8_t event) |
| |
| XRootDStatus | TlsHandShake (AsyncSocketHandler *socketHandler, const std::string &thehost=std::string()) |
| |
| bool | IsEncrypted () |
| |
◆ SocketStatus
Status of the socket.
| Enumerator |
|---|
| Disconnected | The socket is disconnected.
|
| Connected | The socket is connected.
|
| Connecting | The connection process is in progress.
|
◆ Socket()
Constructor
- Parameters
-
| socket | already connected socket if available, -1 otherwise |
| status | status of a socket if available |
◆ ~Socket()
| XrdCl::Socket::~Socket |
( |
| ) |
|
◆ ClassifyErrno()
| static XRootDStatus XrdCl::Socket::ClassifyErrno |
( |
int |
error | ) |
|
|
static |
◆ Close()
| void XrdCl::Socket::Close |
( |
| ) |
|
◆ Connect()
| XRootDStatus XrdCl::Socket::Connect |
( |
const std::string & |
host, |
|
|
uint16_t |
port, |
|
|
uint16_t |
timout = 10 |
|
) |
| |
Connect to the given host name
- Parameters
-
| host | name of the host to connect to |
| port | port to connect to |
| timout | timeout in seconds, 0 for no timeout handling (may be used for non blocking IO) |
◆ ConnectToAddress()
Connect to the given host address
- Parameters
-
| addr | address of the host to connect to |
| timout | timeout in seconds, 0 for no timeout handling (may be used for non blocking IO) |
◆ Cork()
◆ Flash()
◆ GetChannelID()
| const AnyObject* XrdCl::Socket::GetChannelID |
( |
| ) |
const |
|
inline |
Get Channel ID (an object that allows to identify all sockets corresponding to the same channel)
References pChannelID.
◆ GetFD()
| int XrdCl::Socket::GetFD |
( |
| ) |
|
|
inline |
Get the file descriptor.
References pSocket.
◆ GetFlags()
Get the socket flags (man fcntl)
◆ GetName()
| std::string XrdCl::Socket::GetName |
( |
| ) |
const |
Get the string representation of the socket.
◆ GetPeerName()
| std::string XrdCl::Socket::GetPeerName |
( |
| ) |
const |
Get the name of the remote peer.
◆ GetServerAddress()
| const XrdNetAddr& XrdCl::Socket::GetServerAddress |
( |
| ) |
const |
|
inline |
◆ GetSockName()
| std::string XrdCl::Socket::GetSockName |
( |
| ) |
const |
Get the name of the socket.
◆ GetSockOpt()
| XRootDStatus XrdCl::Socket::GetSockOpt |
( |
int |
level, |
|
|
int |
optname, |
|
|
void * |
optval, |
|
|
socklen_t * |
optlen |
|
) |
| |
◆ GetStatus()
Get the socket status.
References pStatus.
◆ Initialize()
| XRootDStatus XrdCl::Socket::Initialize |
( |
int |
family = AF_INET | ) |
|
◆ IsCorked()
| bool XrdCl::Socket::IsCorked |
( |
| ) |
const |
|
inline |
◆ IsEncrypted()
| bool XrdCl::Socket::IsEncrypted |
( |
| ) |
|
◆ MapEvent()
| uint8_t XrdCl::Socket::MapEvent |
( |
uint8_t |
event | ) |
|
◆ Poll()
| XRootDStatus XrdCl::Socket::Poll |
( |
bool |
readyForReading, |
|
|
bool |
readyForWriting, |
|
|
int32_t |
timeout |
|
) |
| |
|
protected |
Poll the socket to see whether it is ready for IO
- Parameters
-
| readyForReading | poll for readiness to read |
| readyForWriting | poll for readiness to write |
| timeout | timeout in seconds, -1 to wait indefinitely |
- Returns
- stOK - ready for IO errSocketDisconnected - on disconnection errSocketError - on socket error errSocketTimeout - on socket timeout errInvalidOp - when called on a non connected socket
◆ Read()
| XRootDStatus XrdCl::Socket::Read |
( |
char * |
buffer, |
|
|
size_t |
size, |
|
|
int & |
bytesRead |
|
) |
| |
Read helper for raw socket
- Parameters
-
| buffer | : the sink for the data |
| size | : size of the sink |
| bytesRead | : number of bytes actually written into the sink |
- Returns
- : success : ( stOK ) EAGAIN : ( stOK, suRetry ) EWOULDBLOCK : ( stOK, suRetry ) other error : ( stError, errSocketError )
◆ ReadRaw()
| XRootDStatus XrdCl::Socket::ReadRaw |
( |
void * |
buffer, |
|
|
uint32_t |
size, |
|
|
int32_t |
timeout, |
|
|
uint32_t & |
bytesRead |
|
) |
| |
Read raw bytes from the socket
- Parameters
-
| buffer | data to be sent |
| size | size of the data buffer |
| timeout | timout value in seconds, -1 to wait indefinitely |
| bytesRead | the amount of data actually read |
◆ Send()
| XRootDStatus XrdCl::Socket::Send |
( |
const char * |
buffer, |
|
|
size_t |
size, |
|
|
int & |
bytesWritten |
|
) |
| |
Portable wrapper around SIGPIPE free send
- Parameters
-
| buffer | : data to be written |
| size | : size of the data buffer |
- Returns
- : the amount of data actually written
◆ SetChannelID()
| void XrdCl::Socket::SetChannelID |
( |
AnyObject * |
channelID | ) |
|
|
inline |
Set Channel ID (an object that allows to identify all sockets corresponding to the same channel)
References pChannelID.
◆ SetFlags()
Set the socket flags (man fcntl)
◆ SetSockOpt()
| XRootDStatus XrdCl::Socket::SetSockOpt |
( |
int |
level, |
|
|
int |
optname, |
|
|
const void * |
optval, |
|
|
socklen_t |
optlen |
|
) |
| |
◆ SetStatus()
Set socket status - do not use unless you know what you're doing.
References pStatus.
◆ TlsHandShake()
◆ Uncork()
◆ WriteRaw()
| XRootDStatus XrdCl::Socket::WriteRaw |
( |
void * |
buffer, |
|
|
uint32_t |
size, |
|
|
int32_t |
timeout, |
|
|
uint32_t & |
bytesWritten |
|
) |
| |
Write raw bytes to the socket
- Parameters
-
| buffer | data to be written |
| size | size of the data buffer |
| timeout | timeout value in seconds, -1 to wait indefinitely |
| bytesWritten | the amount of data actually written |
◆ pChannelID
◆ pCorked
| bool XrdCl::Socket::pCorked |
|
protected |
◆ pName
| std::string XrdCl::Socket::pName |
|
mutableprotected |
◆ pPeerName
| std::string XrdCl::Socket::pPeerName |
|
mutableprotected |
◆ pProtocolFamily
| int XrdCl::Socket::pProtocolFamily |
|
protected |
◆ pServerAddr
◆ pSocket
| int XrdCl::Socket::pSocket |
|
protected |
◆ pSockName
| std::string XrdCl::Socket::pSockName |
|
mutableprotected |
◆ pStatus
◆ pTls
| std::unique_ptr<Tls> XrdCl::Socket::pTls |
|
protected |
The documentation for this class was generated from the following file: