class
#include <eckit/net/TCPServer.h>
EphemeralTCPServer
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
- EphemeralTCPServer(const SocketOptions& = SocketOptions::data())
- EphemeralTCPServer(int port, const SocketOptions& = SocketOptions::data()) explicit
Public functions
- void willFork(bool)
-
auto accept(const std::
string& message = "Waiting for connection", int timeout = 0, bool* connected = nullptr) -> TCPSocket& virtual - 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)
Function documentation
static std:: string eckit:: net:: EphemeralTCPServer:: addrToHost(in_addr)
#include <eckit/net/TCPSocket.h>
static in_addr eckit:: net:: EphemeralTCPServer:: hostToAddr(const std:: string&)
#include <eckit/net/TCPSocket.h>
static std:: string eckit:: net:: EphemeralTCPServer:: hostName(const std:: string& h,
bool full = false)
#include <eckit/net/TCPSocket.h>
static void eckit:: net:: EphemeralTCPServer:: register_ignore_sigpipe()
#include <eckit/net/TCPSocket.h>
long eckit:: net:: EphemeralTCPServer:: write(const void* buf,
long length)
#include <eckit/net/TCPSocket.h>
long eckit:: net:: EphemeralTCPServer:: read(void* buf,
long length)
#include <eckit/net/TCPSocket.h>
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:: net:: EphemeralTCPServer:: rawRead(void*,
long)
#include <eckit/net/TCPSocket.h>
bool eckit:: net:: EphemeralTCPServer:: isConnected() const
#include <eckit/net/TCPSocket.h>
bool eckit:: net:: EphemeralTCPServer:: stillConnected() const
#include <eckit/net/TCPSocket.h>
in_addr eckit:: net:: EphemeralTCPServer:: remoteAddr() const
#include <eckit/net/TCPSocket.h>
const std:: string& eckit:: net:: EphemeralTCPServer:: remoteHost() const
#include <eckit/net/TCPSocket.h>
int eckit:: net:: EphemeralTCPServer:: remotePort() const
#include <eckit/net/TCPSocket.h>
in_addr eckit:: net:: EphemeralTCPServer:: localAddr() const
#include <eckit/net/TCPSocket.h>
const std:: string& eckit:: net:: EphemeralTCPServer:: localHost() const
#include <eckit/net/TCPSocket.h>
int eckit:: net:: EphemeralTCPServer:: localPort() const
#include <eckit/net/TCPSocket.h>
void eckit:: net:: EphemeralTCPServer:: bufferSize(int n)
#include <eckit/net/TCPSocket.h>
void eckit:: net:: EphemeralTCPServer:: receiveBufferSize(int n)
#include <eckit/net/TCPSocket.h>
void eckit:: net:: EphemeralTCPServer:: sendBufferSize(int n)
#include <eckit/net/TCPSocket.h>
void eckit:: net:: EphemeralTCPServer:: closeOutput()
#include <eckit/net/TCPSocket.h>
void eckit:: net:: EphemeralTCPServer:: closeInput()
#include <eckit/net/TCPSocket.h>
void eckit:: net:: EphemeralTCPServer:: debug(bool on)
#include <eckit/net/TCPSocket.h>