Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions
toolbox::net Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  DgramProtocol
 
struct  DgramSock
 Connectionless Datagram Socket. All state is in base class, so object can be sliced. More...
 
struct  IoSock
 
struct  IpMcastGroup
 
struct  McastSock
 Connectionless Datagram Socket. All state is in base class, so object can be sliced. More...
 
class  RateLimit
 
class  RateWindow
 RateWindow maintains a sliding window of second time buckets for the specified interval. More...
 
class  Resolver
 
struct  Sock
 
class  StreamAcceptor
 
class  StreamConnector
 
struct  StreamProtocol
 
struct  StreamSockClnt
 Active Client Stream Socket. All state is in base class, so object can be sliced. More...
 
struct  StreamSockServ
 Passive Server Stream Socket. All state is in base class, so object can be sliced. More...
 
struct  TcpProtocol
 
struct  UdpProtocol
 
struct  UnixDgramProtocol
 
struct  UnixStreamProtocol
 

Typedefs

template<typename ProtocolT >
using BasicEndpoint = boost::asio::generic::basic_endpoint< ProtocolT >
 
using DgramEndpoint = BasicEndpoint< DgramProtocol >
 
using StreamEndpoint = BasicEndpoint< StreamProtocol >
 
template<typename ProtocolT >
using IpEndpoint = boost::asio::ip::basic_endpoint< ProtocolT >
 
using UdpEndpoint = IpEndpoint< UdpProtocol >
 
using TcpEndpoint = IpEndpoint< TcpProtocol >
 
template<typename ProtocolT >
using UnixEndpoint = boost::asio::local::basic_endpoint< ProtocolT >
 
using UnixDgramEndpoint = UnixEndpoint< UnixDgramProtocol >
 
using UnixStreamEndpoint = UnixEndpoint< UnixStreamProtocol >
 
using IpAddr = boost::asio::ip::address
 
using IpAddrV4 = boost::asio::ip::address_v4
 
using IpAddrV6 = boost::asio::ip::address_v6
 
using AddrInfoFuture = std::future< AddrInfoPtr >
 
using AddrInfoPtr = std::unique_ptr< addrinfo, void(*)(addrinfo *)>
 

Functions

constexpr std::uint16_t bswap (std::uint16_t n) noexcept
 
constexpr std::int16_t bswap (std::int16_t n) noexcept
 
constexpr std::uint32_t bswap (std::uint32_t n) noexcept
 
constexpr std::int32_t bswap (std::int32_t n) noexcept
 
constexpr std::uint64_t bswap (std::uint64_t n) noexcept
 
constexpr std::int64_t bswap (std::int64_t n) noexcept
 
template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT ntoh (ValueT n) noexcept
 
template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT hton (ValueT n) noexcept
 
template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT ltoh (ValueT n) noexcept
 
template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT htol (ValueT n) noexcept
 
AddrInfoPtr parse_endpoint (string_view uri, int type)
 
istream & operator>> (istream &is, DgramEndpoint &ep)
 
istream & operator>> (istream &is, StreamEndpoint &ep)
 
ostream & operator<< (ostream &os, const DgramEndpoint &ep)
 
ostream & operator<< (ostream &os, const StreamEndpoint &ep)
 
DgramEndpoint parse_dgram_endpoint (std::string_view uri)
 
StreamEndpoint parse_stream_endpoint (std::string_view uri)
 
const std::error_category & gai_error_category () noexcept
 
std::error_code make_gai_error_code (int err) noexcept
 
constexpr std::uint16_t get_length (const char *buf, std::endian net_byte_order) noexcept
 
std::uint16_t get_length (ConstBuffer buf, std::endian net_byte_order) noexcept
 
void put_length (char *buf, std::uint16_t len, std::endian net_byte_order) noexcept
 
void put_length (MutableBuffer buf, std::uint16_t len, std::endian net_byte_order) noexcept
 
template<typename FnT >
std::size_t parse_frame (ConstBuffer buf, FnT fn, std::endian net_byte_order)
 
template<typename FnT >
std::size_t parse_frame (std::string_view buf, FnT fn, std::endian net_byte_order)
 
template<typename ProtocolT >
std::pair< IoSock, IoSocksocketpair (ProtocolT protocol)
 
void join_group (int sockfd, const IpMcastGroup &group, std::error_code &ec) noexcept
 Join a multicast group.
 
void join_group (int sockfd, const IpMcastGroup &group)
 Join a multicast group.
 
void join_group (int sockfd, const IpAddr &addr, unsigned ifindex, std::error_code &ec) noexcept
 Join a multicast group.
 
void join_group (int sockfd, const IpAddr &addr, unsigned ifindex)
 Join a multicast group.
 
void join_group (int sockfd, const IpAddr &addr, const char *ifname, std::error_code &ec) noexcept
 Join a multicast group. The system will choose an appropriate interface if ifname is null.
 
void join_group (int sockfd, const IpAddr &addr, const char *ifname)
 Join a multicast group. The system will choose an appropriate interface if ifname is null.
 
void leave_group (int sockfd, const IpMcastGroup &group, std::error_code &ec) noexcept
 Leave a multicast group.
 
void leave_group (int sockfd, const IpMcastGroup &group)
 Leave a multicast group.
 
void leave_group (int sockfd, const IpAddr &addr, unsigned ifindex, std::error_code &ec) noexcept
 Leave a multicast group.
 
void leave_group (int sockfd, const IpAddr &addr, unsigned ifindex)
 Leave a multicast group.
 
void leave_group (int sockfd, const IpAddr &addr, const char *ifname, std::error_code &ec) noexcept
 Leave a multicast group. The system will leave on the first matching interface if ifname is null.
 
void leave_group (int sockfd, const IpAddr &addr, const char *ifname)
 Leave a multicast group. The system will leave on the first matching interface if ifname is null.
 
void set_ip_mcast_if (int sockfd, int family, unsigned ifindex, std::error_code &ec) noexcept
 
void set_ip_mcast_if (int sockfd, int family, unsigned ifindex)
 
void set_ip_mcast_if (int sockfd, int family, const char *ifname, std::error_code &ec) noexcept
 
void set_ip_mcast_if (int sockfd, int family, const char *ifname)
 
void set_ip_mcast_loop (int sockfd, int family, bool enabled, std::error_code &ec) noexcept
 Determines whether sent multicast packets should be looped back to the local sockets.
 
void set_ip_mcast_loop (int sockfd, int family, bool enabled)
 Determines whether sent multicast packets should be looped back to the local sockets.
 
void set_ip_mcast_ttl (int sockfd, int family, int ttl, std::error_code &ec) noexcept
 Set or read the time-to-live value of outgoing multicast packets for this socket.
 
void set_ip_mcast_ttl (int sockfd, int family, int ttl)
 Set or read the time-to-live value of outgoing multicast packets for this socket.
 
RateLimit parse_rate_limit (const string &s)
 
istream & operator>> (istream &is, RateLimit &rl)
 
ostream & operator<< (ostream &os, RateLimit rl)
 
template<typename EndpointT >
EndpointT get_endpoint (AddrInfoFuture &future)
 Wait for future and convert result to endpoint.
 
template<typename ResultT >
bool is_ready (std::future< ResultT > &future)
 Returns true if future is ready.
 
AddrInfoPtr get_unix_addrinfo (std::string_view path, int type)
 Create an addrinfo structure for a Unix domain address.
 
template<typename EndpointT >
void get_sock_name (int sockfd, EndpointT &ep, std::error_code &ec) noexcept
 
template<typename EndpointT >
void get_sock_name (int sockfd, EndpointT &ep)
 
std::error_code get_so_error (int sockfd, std::error_code &ec) noexcept
 
std::error_code get_so_error (int sockfd)
 
int get_so_rcv_buf (int sockfd, std::error_code &ec) noexcept
 
int get_so_rcv_buf (int sockfd)
 
int get_so_snd_buf (int sockfd, std::error_code &ec) noexcept
 
int get_so_snd_buf (int sockfd)
 
bool is_tcp_no_delay (int sockfd, std::error_code &ec) noexcept
 
bool is_tcp_no_delay (int sockfd)
 
void set_so_rcv_buf (int sockfd, int size, std::error_code &ec) noexcept
 
void set_so_rcv_buf (int sockfd, int size)
 
void set_so_reuse_addr (int sockfd, bool enabled, std::error_code &ec) noexcept
 
void set_so_reuse_addr (int sockfd, bool enabled)
 
void set_so_snd_buf (int sockfd, int size, std::error_code &ec) noexcept
 
void set_so_snd_buf (int sockfd, int size)
 
void set_tcp_no_delay (int sockfd, bool enabled, std::error_code &ec) noexcept
 
void set_tcp_no_delay (int sockfd, bool enabled)
 
void set_tcp_syn_nt (int sockfd, int retrans, std::error_code &ec) noexcept
 
void set_tcp_syn_nt (int sockfd, int retrans)
 

Typedef Documentation

◆ BasicEndpoint

template<typename ProtocolT >
using toolbox::net::BasicEndpoint = typedef boost::asio::generic::basic_endpoint<ProtocolT>

Definition at line 32 of file Endpoint.hpp.

◆ DgramEndpoint

Definition at line 34 of file Endpoint.hpp.

◆ StreamEndpoint

Definition at line 35 of file Endpoint.hpp.

◆ IpEndpoint

template<typename ProtocolT >
using toolbox::net::IpEndpoint = typedef boost::asio::ip::basic_endpoint<ProtocolT>

Definition at line 38 of file Endpoint.hpp.

◆ UdpEndpoint

Definition at line 40 of file Endpoint.hpp.

◆ TcpEndpoint

Definition at line 41 of file Endpoint.hpp.

◆ UnixEndpoint

template<typename ProtocolT >
using toolbox::net::UnixEndpoint = typedef boost::asio::local::basic_endpoint<ProtocolT>

Definition at line 44 of file Endpoint.hpp.

◆ UnixDgramEndpoint

Definition at line 46 of file Endpoint.hpp.

◆ UnixStreamEndpoint

Definition at line 47 of file Endpoint.hpp.

◆ IpAddr

using toolbox::net::IpAddr = typedef boost::asio::ip::address

Definition at line 24 of file IpAddr.hpp.

◆ IpAddrV4

using toolbox::net::IpAddrV4 = typedef boost::asio::ip::address_v4

Definition at line 25 of file IpAddr.hpp.

◆ IpAddrV6

using toolbox::net::IpAddrV6 = typedef boost::asio::ip::address_v6

Definition at line 26 of file IpAddr.hpp.

◆ AddrInfoFuture

Definition at line 30 of file Resolver.hpp.

◆ AddrInfoPtr

Definition at line 30 of file Socket.hpp.

Function Documentation

◆ bswap() [1/6]

constexpr std::uint16_t toolbox::net::bswap ( std::uint16_t  n)
constexprnoexcept

◆ bswap() [2/6]

constexpr std::int16_t toolbox::net::bswap ( std::int16_t  n)
constexprnoexcept

Definition at line 32 of file Endian.hpp.

◆ bswap() [3/6]

constexpr std::uint32_t toolbox::net::bswap ( std::uint32_t  n)
constexprnoexcept

Definition at line 37 of file Endian.hpp.

◆ bswap() [4/6]

constexpr std::int32_t toolbox::net::bswap ( std::int32_t  n)
constexprnoexcept

Definition at line 42 of file Endian.hpp.

◆ bswap() [5/6]

constexpr std::uint64_t toolbox::net::bswap ( std::uint64_t  n)
constexprnoexcept

Definition at line 47 of file Endian.hpp.

◆ bswap() [6/6]

constexpr std::int64_t toolbox::net::bswap ( std::int64_t  n)
constexprnoexcept

Definition at line 53 of file Endian.hpp.

◆ ntoh()

template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT toolbox::net::ntoh ( ValueT  n)
constexprnoexcept

Definition at line 60 of file Endian.hpp.

◆ hton()

template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT toolbox::net::hton ( ValueT  n)
constexprnoexcept

Definition at line 71 of file Endian.hpp.

◆ ltoh()

template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT toolbox::net::ltoh ( ValueT  n)
constexprnoexcept

Definition at line 82 of file Endian.hpp.

◆ htol()

template<typename ValueT >
requires std::integral<ValueT>
constexpr ValueT toolbox::net::htol ( ValueT  n)
constexprnoexcept

Definition at line 93 of file Endian.hpp.

◆ parse_endpoint()

TOOLBOX_API AddrInfoPtr toolbox::net::parse_endpoint ( string_view  uri,
int  type 
)

Definition at line 59 of file Endpoint.cpp.

Referenced by toolbox::net::Resolver::resolve().

◆ operator>>() [1/3]

TOOLBOX_API std::istream & toolbox::net::operator>> ( istream &  is,
DgramEndpoint ep 
)

Definition at line 100 of file Endpoint.cpp.

◆ operator>>() [2/3]

TOOLBOX_API std::istream & toolbox::net::operator>> ( istream &  is,
StreamEndpoint ep 
)

Definition at line 109 of file Endpoint.cpp.

◆ operator<<() [1/3]

TOOLBOX_API std::ostream & toolbox::net::operator<< ( ostream &  os,
const DgramEndpoint ep 
)

Definition at line 133 of file Endpoint.cpp.

◆ operator<<() [2/3]

TOOLBOX_API std::ostream & toolbox::net::operator<< ( ostream &  os,
const StreamEndpoint ep 
)

Definition at line 155 of file Endpoint.cpp.

◆ parse_dgram_endpoint()

DgramEndpoint toolbox::net::parse_dgram_endpoint ( std::string_view  uri)
inline

Definition at line 51 of file Endpoint.hpp.

◆ parse_stream_endpoint()

StreamEndpoint toolbox::net::parse_stream_endpoint ( std::string_view  uri)
inline

Definition at line 57 of file Endpoint.hpp.

◆ gai_error_category()

TOOLBOX_API const std::error_category & toolbox::net::gai_error_category ( )
noexcept

Definition at line 49 of file Error.cpp.

◆ make_gai_error_code()

TOOLBOX_API std::error_code toolbox::net::make_gai_error_code ( int  err)
noexcept

Definition at line 54 of file Error.cpp.

◆ get_length() [1/2]

constexpr std::uint16_t toolbox::net::get_length ( const char buf,
std::endian  net_byte_order 
)
constexprnoexcept

Reads a binary-encoded 2 byte integer from the input buffer.

Parameters
bufThe input buffer, which must be at least 2 bytes in length.
net_byte_orderEndianness used for network byte order decoding.
Returns
the decoded 2 byte integer.

Definition at line 68 of file Frame.hpp.

◆ get_length() [2/2]

std::uint16_t toolbox::net::get_length ( ConstBuffer  buf,
std::endian  net_byte_order 
)
inlinenoexcept

Reads a binary-encoded 2 byte integer from the input buffer.

Parameters
bufThe input buffer, which must be at least 2 bytes in length.
net_byte_orderEndianness used for network byte order decoding.
Returns
the decoded 2 byte integer.

Definition at line 78 of file Frame.hpp.

◆ put_length() [1/2]

void toolbox::net::put_length ( char buf,
std::uint16_t  len,
std::endian  net_byte_order 
)
inlinenoexcept

Writes a binary-encoded 2 byte integer to the output buffer.

Parameters
bufThe output buffer, which must be at least 2 bytes in length.
lenThe length to be encoded.
net_byte_orderEndianness used for network byte order encoding.

Definition at line 89 of file Frame.hpp.

◆ put_length() [2/2]

void toolbox::net::put_length ( MutableBuffer  buf,
std::uint16_t  len,
std::endian  net_byte_order 
)
inlinenoexcept

Writes a binary-encoded 2 byte integer to the output buffer.

Parameters
bufThe output buffer, which must be at least 2 bytes in length.
lenThe length to be encoded.
net_byte_orderEndianness used for network byte order encoding.

Definition at line 99 of file Frame.hpp.

◆ parse_frame() [1/2]

template<typename FnT >
std::size_t toolbox::net::parse_frame ( ConstBuffer  buf,
FnT  fn,
std::endian  net_byte_order 
)

Calls the function object for each message encapsulated in a length-prefixed frame.

Template Parameters
FnTThe type of the function object.
Parameters
bufThe input buffer.
fnThe function object that is called for each complete message.
net_byte_orderEndianness used for network byte order decoding.
Returns
the total number of consumed bytes.

Definition at line 113 of file Frame.hpp.

◆ parse_frame() [2/2]

template<typename FnT >
std::size_t toolbox::net::parse_frame ( std::string_view  buf,
FnT  fn,
std::endian  net_byte_order 
)

Calls the function object for each message encapsulated in a length-prefixed frame.

Template Parameters
FnTThe type of the function object.
Parameters
bufThe input buffer.
fnThe function object that is called for each complete message.
net_byte_orderEndianness used for network byte order decoding.
Returns
the total number of consumed bytes.

Definition at line 141 of file Frame.hpp.

◆ socketpair()

template<typename ProtocolT >
std::pair< IoSock, IoSock > toolbox::net::socketpair ( ProtocolT  protocol)
inline

Definition at line 90 of file IoSock.hpp.

◆ join_group() [1/6]

void toolbox::net::join_group ( int  sockfd,
const IpMcastGroup group,
std::error_code &  ec 
)
inlinenoexcept

Join a multicast group.

Definition at line 47 of file McastSock.hpp.

◆ join_group() [2/6]

void toolbox::net::join_group ( int  sockfd,
const IpMcastGroup group 
)
inline

Join a multicast group.

Definition at line 58 of file McastSock.hpp.

◆ join_group() [3/6]

void toolbox::net::join_group ( int  sockfd,
const IpAddr addr,
unsigned  ifindex,
std::error_code &  ec 
)
inlinenoexcept

Join a multicast group.

Definition at line 69 of file McastSock.hpp.

◆ join_group() [4/6]

void toolbox::net::join_group ( int  sockfd,
const IpAddr addr,
unsigned  ifindex 
)
inline

Join a multicast group.

Definition at line 76 of file McastSock.hpp.

◆ join_group() [5/6]

void toolbox::net::join_group ( int  sockfd,
const IpAddr addr,
const char ifname,
std::error_code &  ec 
)
inlinenoexcept

Join a multicast group. The system will choose an appropriate interface if ifname is null.

Definition at line 82 of file McastSock.hpp.

◆ join_group() [6/6]

void toolbox::net::join_group ( int  sockfd,
const IpAddr addr,
const char ifname 
)
inline

Join a multicast group. The system will choose an appropriate interface if ifname is null.

Definition at line 89 of file McastSock.hpp.

◆ leave_group() [1/6]

void toolbox::net::leave_group ( int  sockfd,
const IpMcastGroup group,
std::error_code &  ec 
)
inlinenoexcept

Leave a multicast group.

Definition at line 95 of file McastSock.hpp.

◆ leave_group() [2/6]

void toolbox::net::leave_group ( int  sockfd,
const IpMcastGroup group 
)
inline

Leave a multicast group.

Definition at line 106 of file McastSock.hpp.

◆ leave_group() [3/6]

void toolbox::net::leave_group ( int  sockfd,
const IpAddr addr,
unsigned  ifindex,
std::error_code &  ec 
)
inlinenoexcept

Leave a multicast group.

Definition at line 117 of file McastSock.hpp.

◆ leave_group() [4/6]

void toolbox::net::leave_group ( int  sockfd,
const IpAddr addr,
unsigned  ifindex 
)
inline

Leave a multicast group.

Definition at line 124 of file McastSock.hpp.

◆ leave_group() [5/6]

void toolbox::net::leave_group ( int  sockfd,
const IpAddr addr,
const char ifname,
std::error_code &  ec 
)
inlinenoexcept

Leave a multicast group. The system will leave on the first matching interface if ifname is null.

Definition at line 130 of file McastSock.hpp.

◆ leave_group() [6/6]

void toolbox::net::leave_group ( int  sockfd,
const IpAddr addr,
const char ifname 
)
inline

Leave a multicast group. The system will leave on the first matching interface if ifname is null.

Definition at line 137 of file McastSock.hpp.

◆ set_ip_mcast_if() [1/4]

void toolbox::net::set_ip_mcast_if ( int  sockfd,
int  family,
unsigned  ifindex,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 142 of file McastSock.hpp.

◆ set_ip_mcast_if() [2/4]

void toolbox::net::set_ip_mcast_if ( int  sockfd,
int  family,
unsigned  ifindex 
)
inline

Definition at line 154 of file McastSock.hpp.

◆ set_ip_mcast_if() [3/4]

void toolbox::net::set_ip_mcast_if ( int  sockfd,
int  family,
const char ifname,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 166 of file McastSock.hpp.

◆ set_ip_mcast_if() [4/4]

void toolbox::net::set_ip_mcast_if ( int  sockfd,
int  family,
const char ifname 
)
inline

Definition at line 175 of file McastSock.hpp.

◆ set_ip_mcast_loop() [1/2]

void toolbox::net::set_ip_mcast_loop ( int  sockfd,
int  family,
bool  enabled,
std::error_code &  ec 
)
inlinenoexcept

Determines whether sent multicast packets should be looped back to the local sockets.

Definition at line 181 of file McastSock.hpp.

◆ set_ip_mcast_loop() [2/2]

void toolbox::net::set_ip_mcast_loop ( int  sockfd,
int  family,
bool  enabled 
)
inline

Determines whether sent multicast packets should be looped back to the local sockets.

Definition at line 194 of file McastSock.hpp.

◆ set_ip_mcast_ttl() [1/2]

void toolbox::net::set_ip_mcast_ttl ( int  sockfd,
int  family,
int  ttl,
std::error_code &  ec 
)
inlinenoexcept

Set or read the time-to-live value of outgoing multicast packets for this socket.

Definition at line 207 of file McastSock.hpp.

◆ set_ip_mcast_ttl() [2/2]

void toolbox::net::set_ip_mcast_ttl ( int  sockfd,
int  family,
int  ttl 
)
inline

Set or read the time-to-live value of outgoing multicast packets for this socket.

Definition at line 220 of file McastSock.hpp.

◆ parse_rate_limit()

TOOLBOX_API RateLimit toolbox::net::parse_rate_limit ( const string &  s)

Definition at line 24 of file RateLimit.cpp.

◆ operator>>() [3/3]

TOOLBOX_API std::istream & toolbox::net::operator>> ( istream &  is,
RateLimit rl 
)

Definition at line 30 of file RateLimit.cpp.

◆ operator<<() [3/3]

TOOLBOX_API std::ostream & toolbox::net::operator<< ( ostream &  os,
RateLimit  rl 
)

Definition at line 39 of file RateLimit.cpp.

◆ get_endpoint()

template<typename EndpointT >
EndpointT toolbox::net::get_endpoint ( AddrInfoFuture future)

Wait for future and convert result to endpoint.

Definition at line 69 of file Resolver.hpp.

◆ is_ready()

template<typename ResultT >
bool toolbox::net::is_ready ( std::future< ResultT > &  future)

Returns true if future is ready.

Definition at line 78 of file Resolver.hpp.

◆ get_unix_addrinfo()

TOOLBOX_API AddrInfoPtr toolbox::net::get_unix_addrinfo ( string_view  path,
int  type 
)

Create an addrinfo structure for a Unix domain address.

Definition at line 35 of file Socket.cpp.

◆ get_sock_name() [1/2]

template<typename EndpointT >
void toolbox::net::get_sock_name ( int  sockfd,
EndpointT ep,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 619 of file Socket.hpp.

◆ get_sock_name() [2/2]

template<typename EndpointT >
void toolbox::net::get_sock_name ( int  sockfd,
EndpointT ep 
)
inline

Definition at line 625 of file Socket.hpp.

◆ get_so_error() [1/2]

std::error_code toolbox::net::get_so_error ( int  sockfd,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 630 of file Socket.hpp.

◆ get_so_error() [2/2]

std::error_code toolbox::net::get_so_error ( int  sockfd)
inline

Definition at line 638 of file Socket.hpp.

◆ get_so_rcv_buf() [1/2]

int toolbox::net::get_so_rcv_buf ( int  sockfd,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 646 of file Socket.hpp.

◆ get_so_rcv_buf() [2/2]

int toolbox::net::get_so_rcv_buf ( int  sockfd)
inline

Definition at line 654 of file Socket.hpp.

◆ get_so_snd_buf() [1/2]

int toolbox::net::get_so_snd_buf ( int  sockfd,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 662 of file Socket.hpp.

◆ get_so_snd_buf() [2/2]

int toolbox::net::get_so_snd_buf ( int  sockfd)
inline

Definition at line 670 of file Socket.hpp.

◆ is_tcp_no_delay() [1/2]

bool toolbox::net::is_tcp_no_delay ( int  sockfd,
std::error_code &  ec 
)
inlinenoexcept

◆ is_tcp_no_delay() [2/2]

bool toolbox::net::is_tcp_no_delay ( int  sockfd)
inline

Definition at line 686 of file Socket.hpp.

◆ set_so_rcv_buf() [1/2]

void toolbox::net::set_so_rcv_buf ( int  sockfd,
int  size,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 694 of file Socket.hpp.

◆ set_so_rcv_buf() [2/2]

void toolbox::net::set_so_rcv_buf ( int  sockfd,
int  size 
)
inline

Definition at line 699 of file Socket.hpp.

◆ set_so_reuse_addr() [1/2]

void toolbox::net::set_so_reuse_addr ( int  sockfd,
bool  enabled,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 704 of file Socket.hpp.

◆ set_so_reuse_addr() [2/2]

void toolbox::net::set_so_reuse_addr ( int  sockfd,
bool  enabled 
)
inline

Definition at line 710 of file Socket.hpp.

◆ set_so_snd_buf() [1/2]

void toolbox::net::set_so_snd_buf ( int  sockfd,
int  size,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 716 of file Socket.hpp.

◆ set_so_snd_buf() [2/2]

void toolbox::net::set_so_snd_buf ( int  sockfd,
int  size 
)
inline

Definition at line 721 of file Socket.hpp.

◆ set_tcp_no_delay() [1/2]

void toolbox::net::set_tcp_no_delay ( int  sockfd,
bool  enabled,
std::error_code &  ec 
)
inlinenoexcept

Enable or disable the Nagle algorithm.

This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets, which results in poor utilization of the network.

Parameters
sockfdThe socket descriptor.
enabledBoolean switch to enable or disable.
ecError-code set on failure.

Definition at line 736 of file Socket.hpp.

Referenced by toolbox::net::StreamConnector< DerivedT >::connect(), and toolbox::net::StreamAcceptor< DerivedT >::~StreamAcceptor().

◆ set_tcp_no_delay() [2/2]

void toolbox::net::set_tcp_no_delay ( int  sockfd,
bool  enabled 
)
inline

Enable or disable the Nagle algorithm.

This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets, which results in poor utilization of the network.

Parameters
sockfdThe socket descriptor.
enabledBoolean switch to enable or disable.

Definition at line 751 of file Socket.hpp.

◆ set_tcp_syn_nt() [1/2]

void toolbox::net::set_tcp_syn_nt ( int  sockfd,
int  retrans,
std::error_code &  ec 
)
inlinenoexcept

Set the number of SYN retransmits that TCP should send before aborting the attempt to connect.

The number of retransmits cannot exceed 255.

Parameters
sockfdThe socket descriptor.
retransThe number of retransmits.
ecError-code set on failure.

Definition at line 764 of file Socket.hpp.

◆ set_tcp_syn_nt() [2/2]

void toolbox::net::set_tcp_syn_nt ( int  sockfd,
int  retrans 
)
inline

Set the number of SYN retransmits that TCP should send before aborting the attempt to connect.

The number of retransmits cannot exceed 255.

Parameters
sockfdThe socket descriptor.
retransThe number of retransmits.

Definition at line 775 of file Socket.hpp.