22#ifndef IO_SOCKET_ADDRESS_HPP
23#define IO_SOCKET_ADDRESS_HPP
24#include "detail/socket.hpp"
35template <SocketAddress Addr = sockaddr_storage_type>
53 template <socklen_type Size = sizeof(Addr)>
54 requires(Size <=
sizeof(Addr))
56 :
Base(std::span<const std::byte, Size>(
58 reinterpret_cast<const std::byte *
>(addr), size))
67 template <SocketAddress OtherAddr>
69 :
Base(std::span<
const std::byte,
sizeof(OtherAddr)>(other))
79template <SocketAddress Addr = sockaddr_storage_type>
86 return {
reinterpret_cast<const sockaddr_type *
>(addr),
sizeof(Addr)};
A generic wrapper for socket options.
Definition socket_option.hpp:36
This file defines concepts for the execution components.
The io::socket namespace provides a cross-platform abstraction for socket-level I/O operations.
Definition poll_multiplexer.hpp:36
auto make_address(const Addr *addr=nullptr) -> socket_address< Addr >
Creates a socket_address from a socket address structure.
Definition socket_address.hpp:80
Defines the socket_option wrapper for native socket options.
Represents a platform-independent socket address.
Definition socket_address.hpp:36
socket_address(const sockaddr_type *addr, socklen_type size=Size) noexcept
Constructs a socket_address from a raw socket address structure.
Definition socket_address.hpp:55
socket_option< Addr > Base
The base class for the socket address.
Definition socket_address.hpp:40
socket_address(const socket_address< OtherAddr > &other) noexcept
Constructs a socket_address from another socket_address.
Definition socket_address.hpp:68