eckit::ProxiedTCPServer class

Base classes

class TCPServer

Public static functions

static auto addrToHost(in_addr) -> std::string
static auto hostToAddr(const std::string&) -> in_addr
static auto hostName(const std::string& h, bool full = false) -> std::string
static void register_ignore_sigpipe()

Constructors, destructors, conversion operators

ProxiedTCPServer(int port = 0, const net::SocketOptions& = net::SocketOptions::server())
~ProxiedTCPServer()

Public functions

auto accept(const std::string& message = "Waiting for connection", int timeout = 0, bool* connected = nullptr) -> net::TCPSocket& override
void willFork(bool)
void closeExec(bool on)
auto socket() -> int override
void close() override
auto write(const void* buf, long length) -> long
auto read(void* buf, long length) -> long
auto rawRead(void*, long) -> long
auto isConnected() const -> bool
auto stillConnected() const -> bool
auto remoteAddr() const -> in_addr
auto remoteHost() const -> const std::string&
auto remotePort() const -> int
auto localAddr() const -> in_addr
auto localHost() const -> const std::string&
auto localPort() const -> int
void bufferSize(int n)
void receiveBufferSize(int n)
void sendBufferSize(int n)
void closeOutput()
void closeInput()
void debug(bool on)

Private functions

void print(std::ostream& s) const override

Function documentation

static std::string eckit::ProxiedTCPServer::addrToHost(in_addr)

static in_addr eckit::ProxiedTCPServer::hostToAddr(const std::string&)

static std::string eckit::ProxiedTCPServer::hostName(const std::string& h, bool full = false)

static void eckit::ProxiedTCPServer::register_ignore_sigpipe()

void eckit::ProxiedTCPServer::willFork(bool)

void eckit::ProxiedTCPServer::closeExec(bool on)

int eckit::ProxiedTCPServer::socket() override

void eckit::ProxiedTCPServer::close() override

long eckit::ProxiedTCPServer::write(const void* buf, long length)

long eckit::ProxiedTCPServer::read(void* buf, long length)

Parameters
buf The buffer to read into
length The maximum number of bytes to read

Read from a TCP socket

Configuration flags

  • useSelectOnTCPSocket (bool): use select for improved resilience on flaky connections
  • socketSelectTimeout (long): timeout in seconds for the select (only if useSelectOnTCPSocket is enabled)

long eckit::ProxiedTCPServer::rawRead(void*, long)

bool eckit::ProxiedTCPServer::isConnected() const

bool eckit::ProxiedTCPServer::stillConnected() const

in_addr eckit::ProxiedTCPServer::remoteAddr() const

const std::string& eckit::ProxiedTCPServer::remoteHost() const

int eckit::ProxiedTCPServer::remotePort() const

in_addr eckit::ProxiedTCPServer::localAddr() const

const std::string& eckit::ProxiedTCPServer::localHost() const

int eckit::ProxiedTCPServer::localPort() const

void eckit::ProxiedTCPServer::bufferSize(int n)

void eckit::ProxiedTCPServer::receiveBufferSize(int n)

void eckit::ProxiedTCPServer::sendBufferSize(int n)

void eckit::ProxiedTCPServer::closeOutput()

void eckit::ProxiedTCPServer::closeInput()

void eckit::ProxiedTCPServer::debug(bool on)