AsyncBerkeley
Asynchronous Berkeley sockets. Simple.
Loading...
Searching...
No Matches
Classes | Functions
io::socket Namespace Reference

The io::socket namespace provides a cross-platform abstraction for socket-level I/O operations. More...

Classes

class  message_buffer
 A container for managing buffers for scatter-gather I/O operations. More...
 
struct  message_header
 Represents the header of a socket message. More...
 
struct  socket_address
 Represents a platform-independent socket address. More...
 
struct  socket_dialog
 A dialog that facilitates asynchronous operations on the socket by the executor. More...
 
class  socket_handle
 A thread-safe, move-only RAII wrapper for a native socket handle. More...
 
struct  socket_message
 Represents a complete socket message. More...
 
class  socket_option
 A generic wrapper for socket options. More...
 

Functions

template<SocketAddress Addr = sockaddr_storage_type>
auto make_address (const Addr *addr=nullptr) -> socket_address< Addr >
 Creates a socket_address from a socket address structure.
 
template<Multiplexer Mux>
auto operator<=> (const socket_dialog< Mux > &lhs, const socket_dialog< Mux > &rhs) -> std::strong_ordering
 Compares two socket_dialog objects.
 
template<Multiplexer Mux>
auto operator== (const socket_dialog< Mux > &lhs, const socket_dialog< Mux > &rhs) -> bool
 Checks for equality between two socket_dialog objects.
 
template<Multiplexer Mux>
auto operator<=> (const socket_dialog< Mux > &lhs, const socket_handle &rhs) -> std::strong_ordering
 Compares a socket_dialog and a socket_handle.
 
template<Multiplexer Mux>
auto operator== (const socket_dialog< Mux > &lhs, const socket_handle &rhs) -> bool
 Checks for equality between a socket_dialog and a socket_handle.
 
template<Multiplexer Mux>
auto operator<=> (const socket_dialog< Mux > &lhs, native_socket_type rhs) -> std::strong_ordering
 Compares a socket_dialog and a native_socket.
 
template<Multiplexer Mux>
auto operator== (const socket_dialog< Mux > &lhs, native_socket_type rhs) -> bool
 Checks for equality between a socket_dialog and a native_socket.
 

Detailed Description

The io::socket namespace provides a cross-platform abstraction for socket-level I/O operations.

Function Documentation

◆ make_address()

template<SocketAddress Addr = sockaddr_storage_type>
auto io::socket::make_address ( const Addr *  addr = nullptr) -> socket_address<Addr>

Creates a socket_address from a socket address structure.

Template Parameters
SockAddrThe type of the socket address structure.
Parameters
addrA pointer to the socket address structure.
Returns
A socket_address object.

◆ operator<=>() [1/3]

template<Multiplexer Mux>
auto io::socket::operator<=> ( const socket_dialog< Mux > &  lhs,
const socket_dialog< Mux > &  rhs 
) -> std::strong_ordering

Compares two socket_dialog objects.

Parameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Returns
A std::strong_ordering indicating the result of the comparison.
Exceptions
std::invalid_argumentif the underlying socket of either side is nullptr.

◆ operator<=>() [2/3]

template<Multiplexer Mux>
auto io::socket::operator<=> ( const socket_dialog< Mux > &  lhs,
const socket_handle rhs 
) -> std::strong_ordering

Compares a socket_dialog and a socket_handle.

Parameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Returns
A std::strong_ordering indicating the result of the comparison.
Exceptions
std::invalid_argumentif the underlying socket is nullptr.

◆ operator<=>() [3/3]

template<Multiplexer Mux>
auto io::socket::operator<=> ( const socket_dialog< Mux > &  lhs,
native_socket_type  rhs 
) -> std::strong_ordering

Compares a socket_dialog and a native_socket.

Parameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Returns
A std::strong_ordering indicating the result of the comparison.
Exceptions
std::invalid_argumentif the underlying socket is nullptr.

◆ operator==() [1/3]

template<Multiplexer Mux>
auto io::socket::operator== ( const socket_dialog< Mux > &  lhs,
const socket_dialog< Mux > &  rhs 
) -> bool

Checks for equality between two socket_dialog objects.

Parameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Returns
true if the two objects are equal, false otherwise.
Exceptions
std::invalid_argumentif the underlying socket of either side is nullptr.

◆ operator==() [2/3]

template<Multiplexer Mux>
auto io::socket::operator== ( const socket_dialog< Mux > &  lhs,
const socket_handle rhs 
) -> bool

Checks for equality between a socket_dialog and a socket_handle.

Parameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Returns
true if the two objects are equal, false otherwise.
Exceptions
std::invalid_argumentif the underlying socket is nullptr.

◆ operator==() [3/3]

template<Multiplexer Mux>
auto io::socket::operator== ( const socket_dialog< Mux > &  lhs,
native_socket_type  rhs 
) -> bool

Checks for equality between a socket_dialog and a native_socket.

Parameters
lhsThe left-hand side of the comparison.
rhsThe right-hand side of the comparison.
Returns
true if the two objects are equal, false otherwise.
Exceptions
std::invalid_argumentif the underlying socket is nullptr.