TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
Loading...
Searching...
No Matches
tec::SocketClientParams Struct Reference

Parameters specific to client-side socket connections. More...

#include <tec_socket.hpp>

Inheritance diagram for tec::SocketClientParams:
tec::SocketParams

Public Member Functions

 SocketClientParams ()
 Default constructor.
 
- Public Member Functions inherited from tec::SocketParams
 SocketParams ()
 Default constructor.
 

Additional Inherited Members

- Public Attributes inherited from tec::SocketParams
std::string addr
 Target address or hostname.
 
int port
 Port number to connect to or bind.
 
int family
 Address family (AF_INET, AF_INET6, AF_UNSPEC, ...).
 
int socktype
 Socket type (SOCK_STREAM, SOCK_DGRAM, ...).
 
int protocol
 Protocol (usually 0).
 
int flags
 Flags passed to getaddrinfo().
 
int compression
 Compression algorithm to use (see CompressionParams).
 
int compression_level
 Compression level [0..9] (higher = better compression, slower).
 
size_t compression_min_size
 Minimum size of data to apply compression (bytes).
 
size_t buffer_size
 Buffer size for using in send/recv operations (bytes).
 
- Static Public Attributes inherited from tec::SocketParams
static constexpr char kAnyAddr [] {"0.0.0.0"}
 IPv4 address to bind/accept connections from any interface.
 
static constexpr char kLocalAddr [] {"127.0.0.1"}
 IPv4 loopback address (localhost).
 
static constexpr char kLocalURI [] {"localhost"}
 Hostname that resolves to localhost for both IPv4 and IPv6.
 
static constexpr char kAnyAddrIP6 [] {"::"}
 IPv6 address to bind/accept connections from any interface.
 
static constexpr char kLocalAddrIP6 [] {"::1"}
 IPv6 loopback address (localhost).
 
static constexpr int kDefaultPort {4321}
 Default port number used for testing and examples.
 
static constexpr int kDefaultFamily {AF_UNSPEC}
 Default address family: AF_UNSPEC allows both IPv4 and IPv6.
 
static constexpr int kDefaultSockType {SOCK_STREAM}
 Default socket type: TCP stream socket.
 
static constexpr int kDefaultProtocol {0}
 Default protocol: 0 means "any appropriate protocol".
 
static constexpr int kDefaultServerFlags {AI_PASSIVE}
 Default addrinfo flags for server sockets (bind to local address).
 
static constexpr int kDefaultClientFlags {0}
 Default addrinfo flags for client sockets (no special behaviour).
 
static constexpr char kNullChar {0}
 Null character constant (for internal use).
 
static constexpr size_t kDefaultBufSize {BUFSIZ}
 Default buffer size as defined in stdio.h (8192).
 

Detailed Description

Parameters specific to client-side socket connections.

Inherits all common parameters from SocketParams and sets client-specific defaults.

Constructor & Destructor Documentation

◆ SocketClientParams()

tec::SocketClientParams::SocketClientParams ( )
inline

Default constructor.

Sets addrinfo flags appropriate for client use (no AI_PASSIVE).


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