xrootd
|
#include <XrdClientSock.hh>
Public Types | |
typedef int | Sockid |
typedef int | Sockdescr |
Public Member Functions | |
XrdClientSock (XrdClientUrlInfo host, int windowsize=0, int fd=-1) | |
virtual | ~XrdClientSock () |
virtual void | BanSockDescr (Sockdescr, Sockid) |
virtual void | UnBanSockDescr (Sockdescr) |
void | ReinitFDTable () |
virtual int | RecvRaw (void *buffer, int length, Sockid substreamid=-1, Sockid *usedsubstreamid=0) |
virtual int | SendRaw (const void *buffer, int length, Sockid substreamid=0) |
void | SetRequestTimeout (int timeout=-1) |
virtual int | Socks4Handshake (Sockid sockid) |
virtual void | TryConnect (bool isUnix=0) |
virtual Sockdescr | TryConnectParallelSock (int, int, Sockid &) |
virtual int | EstablishParallelSock (Sockid, Sockid) |
virtual int | RemoveParallelSock (Sockid) |
virtual Sockid | GetSockIdHint (int) |
virtual void | Disconnect () |
bool | IsConnected () |
virtual int | GetSockIdCount () |
virtual void | PauseSelectOnSubstream (Sockid) |
virtual void | RestartSelectOnSubstream (Sockid) |
Protected Member Functions | |
virtual int | SaveSocket () |
void | SetInterrupt (int which=0) |
int | TryConnect_low (bool isUnix=0, int altport=0, int windowsz=0) |
virtual int | SendRaw_sock (const void *buffer, int length, Sockdescr sock) |
Protected Attributes | |
int | fRequestTimeout |
XrdClientSockConnectParms | fHost |
bool | fConnected |
bool | fRDInterrupt |
bool | fWRInterrupt |
bool | fReinit_fd |
Private Attributes | |
int | fSocket |
Friends | |
class | XrdClientPhyConnection |
typedef int XrdClientSock::Sockdescr |
typedef int XrdClientSock::Sockid |
XrdClientSock::XrdClientSock | ( | XrdClientUrlInfo | host, |
int | windowsize = 0 , |
||
int | fd = -1 |
||
) |
Construct a socket helper
host | Remote location to connect to |
windowSize | TCP window size: 0 for OS defaults or the ENV setting |
fd | A descriptor pointing to an already connected socket, -1 if not available |
References EnvGetLong, FALSE, fConnected, fHost, fRDInterrupt, fRequestTimeout, fSocket, fWRInterrupt, NAME_REQUESTTIMEOUT, XrdClientSockConnectParms::TcpHost, XrdClientSockConnectParms::TcpWindowSize, and TRUE.
XrdClientSock::~XrdClientSock | ( | ) | [virtual] |
References Disconnect().
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::BanSockDescr().
void XrdClientSock::Disconnect | ( | ) | [virtual] |
Reimplemented in XrdClientPSock.
References close, fConnected, and fSocket.
Referenced by XrdClientPhyConnection::Disconnect(), TryConnect(), and ~XrdClientSock().
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::EstablishPendingParallelStream().
virtual int XrdClientSock::GetSockIdCount | ( | ) | [inline, virtual] |
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::GetSockIdCount().
virtual Sockid XrdClientSock::GetSockIdHint | ( | int | ) | [inline, virtual] |
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::GetSockIdHint().
bool XrdClientSock::IsConnected | ( | ) | [inline] |
References fConnected.
Referenced by XrdClientPhyConnection::Connect(), XrdClientPhyConnection::IsValid(), XrdClientPhyConnection::ReadRaw(), and XrdClientPhyConnection::WriteRaw().
virtual void XrdClientSock::PauseSelectOnSubstream | ( | Sockid | ) | [inline, virtual] |
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::PauseSelectOnSubstream().
int XrdClientSock::RecvRaw | ( | void * | buffer, |
int | length, | ||
Sockid | substreamid = -1 , |
||
Sockid * | usedsubstreamid = 0 |
||
) | [virtual] |
Reimplemented in XrdClientPSock.
References DebugLevel, Error, pollfd::events, EWOULDBLOCK, FALSE, fConnected, pollfd::fd, fHost, fRDInterrupt, fRequestTimeout, fSocket, XrdClientUrlInfo::Host, Info, XrdClientDebug::kDUMPDEBUG, XrdClientDebug::kNODEBUG, poll(), POLLERR, POLLHUP, POLLIN, POLLNVAL, POLLPRI, XrdClientUrlInfo::Port, pollfd::revents, XrdClientSockConnectParms::TcpHost, TXSOCK_ERR, TXSOCK_ERR_INTERRUPT, and TXSOCK_ERR_TIMEOUT.
Referenced by XrdClientPhyConnection::ReadRaw(), and Socks4Handshake().
void XrdClientSock::ReinitFDTable | ( | ) | [inline] |
References fReinit_fd.
Referenced by XrdClientPSock::RecvRaw(), and XrdClientPhyConnection::ReinitFDTable().
virtual int XrdClientSock::RemoveParallelSock | ( | Sockid | ) | [inline, virtual] |
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::RemoveParallelStream().
virtual void XrdClientSock::RestartSelectOnSubstream | ( | Sockid | ) | [inline, virtual] |
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::RestartSelectOnSubstream().
virtual int XrdClientSock::SaveSocket | ( | ) | [inline, protected, virtual] |
Reimplemented in XrdClientPSock.
References fConnected, fRDInterrupt, fSocket, and fWRInterrupt.
Referenced by XrdClientPhyConnection::SaveSocket().
int XrdClientSock::SendRaw | ( | const void * | buffer, |
int | length, | ||
Sockid | substreamid = 0 |
||
) | [virtual] |
Reimplemented in XrdClientPSock.
References fSocket, and SendRaw_sock().
Referenced by Socks4Handshake(), and XrdClientPhyConnection::WriteRaw().
int XrdClientSock::SendRaw_sock | ( | const void * | buffer, |
int | length, | ||
Sockdescr | sock | ||
) | [protected, virtual] |
References Error, pollfd::events, EWOULDBLOCK, fConnected, pollfd::fd, fHost, fRequestTimeout, fWRInterrupt, XrdClientUrlInfo::Host, poll(), POLLERR, POLLHUP, POLLNVAL, POLLOUT, XrdClientUrlInfo::Port, pollfd::revents, sleep, XrdClientSockConnectParms::TcpHost, TXSOCK_ERR, TXSOCK_ERR_INTERRUPT, and TXSOCK_ERR_TIMEOUT.
Referenced by SendRaw().
void XrdClientSock::SetInterrupt | ( | int | which = 0 | ) | [inline, protected] |
References fRDInterrupt, and fWRInterrupt.
Referenced by XrdClientPhyConnection::SetInterrupt().
void XrdClientSock::SetRequestTimeout | ( | int | timeout = -1 | ) |
References EnvGetLong, fRequestTimeout, and NAME_REQUESTTIMEOUT.
int XrdClientSock::Socks4Handshake | ( | Sockid | sockid | ) | [virtual] |
References XrdOucString::c_str(), cuserid(), fHost, XrdClientUrlInfo::HostAddr, XrdClientUrlInfo::Port, XrdMonCtrCollector::port, RecvRaw(), SendRaw(), and XrdClientSockConnectParms::TcpHost.
Referenced by TryConnect().
void XrdClientSock::TryConnect | ( | bool | isUnix = 0 | ) | [virtual] |
Reimplemented in XrdClientPSock.
References Disconnect(), EnvGetString, fConnected, fSocket, Info, XrdClientDebug::kHIDEBUG, NAME_SOCKS4HOST, Socks4Handshake(), and TryConnect_low().
Referenced by XrdClientPhyConnection::Connect().
int XrdClientSock::TryConnect_low | ( | bool | isUnix = 0 , |
int | altport = 0 , |
||
int | windowsz = 0 |
||
) | [protected] |
References XrdOucString::c_str(), EnvGetLong, EnvGetString, Error, fConnected, fHost, XrdClientUrlInfo::File, XrdClientUrlInfo::Host, XrdClientUrlInfo::HostAddr, Info, XrdClientDebug::kHIDEBUG, XrdOucString::length(), NAME_CONNECTTIMEOUT, NAME_DFLTTCPWINDOWSIZE, NAME_ENABLE_TCP_KEEPALIVE, NAME_SOCKS4HOST, NAME_SOCKS4PORT, NAME_TCP_KEEPALIVE_INTERVAL, NAME_TCP_KEEPALIVE_PROBES, NAME_TCP_KEEPALIVE_TIME, XrdClientUrlInfo::Port, XrdMonCtrCollector::port, XrdNetSocket::setOpts(), XrdClientSockConnectParms::TcpHost, TRUE, and XRDNET_KEEPALIVE.
Referenced by TryConnect(), XrdClientPSock::TryConnect(), and XrdClientPSock::TryConnectParallelSock().
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::TryConnectParallelStream().
virtual void XrdClientSock::UnBanSockDescr | ( | Sockdescr | ) | [inline, virtual] |
Reimplemented in XrdClientPSock.
Referenced by XrdClientPhyConnection::UnBanSockDescr().
friend class XrdClientPhyConnection [friend] |
Reimplemented in XrdClientPSock.
bool XrdClientSock::fConnected [protected] |
XrdClientSockConnectParms XrdClientSock::fHost [protected] |
Referenced by RecvRaw(), SendRaw_sock(), Socks4Handshake(), TryConnect_low(), and XrdClientSock().
bool XrdClientSock::fRDInterrupt [protected] |
Referenced by RecvRaw(), XrdClientPSock::RecvRaw(), SaveSocket(), XrdClientPSock::SaveSocket(), SetInterrupt(), and XrdClientSock().
bool XrdClientSock::fReinit_fd [protected] |
Referenced by XrdClientPSock::RecvRaw(), ReinitFDTable(), and XrdClientPSock::XrdClientPSock().
int XrdClientSock::fRequestTimeout [protected] |
Referenced by RecvRaw(), SendRaw_sock(), SetRequestTimeout(), and XrdClientSock().
int XrdClientSock::fSocket [private] |
Referenced by Disconnect(), XrdClientPhyConnection::GetSocket(), RecvRaw(), SaveSocket(), SendRaw(), TryConnect(), and XrdClientSock().
bool XrdClientSock::fWRInterrupt [protected] |
Referenced by SaveSocket(), XrdClientPSock::SaveSocket(), SendRaw_sock(), SetInterrupt(), and XrdClientSock().