19#ifndef CPPNET_ASYNC_UDP_SERVICE_HPP
20#define CPPNET_ASYNC_UDP_SERVICE_HPP
65template <
typename UDPStreamHandler, std::
size_t Size = 64 * 1024UL>
126 std::shared_ptr<read_context>
rctx) ->
void;
136 template <
typename T>
141 using socket_type = io::socket::native_socket_type;
153 std::shared_ptr<read_context>
rctx = {},
154 std::span<const std::byte>
buf = {}) ->
void;
169 auto stop_() ->
void;
177 std::atomic<socket_type> server_sockfd_ = io::socket::INVALID_SOCKET;
182#include "impl/async_udp_service_impl.hpp"
This file declares an asynchronous execution context.
A ServiceLike Async UDP Service.
Definition async_udp_service.hpp:66
async_udp_service()=default
Default constructor.
io::socket::socket_address< T > socket_address
Templated socket address type.
Definition async_udp_service.hpp:69
async_context::async_scope async_scope
The async scope type.
Definition async_udp_service.hpp:73
io::socket::socket_dialog< multiplexer_type > socket_dialog
The socket dialog type.
Definition async_udp_service.hpp:79
auto submit_recv(async_context &ctx, const socket_dialog &socket, std::shared_ptr< read_context > rctx) -> void
Submits an asynchronous socket recv.
io::socket::socket_handle socket_handle
The socket handle type.
Definition async_udp_service.hpp:77
async_context::multiplexer_type multiplexer_type
The io multiplexer type.
Definition async_udp_service.hpp:75
auto start(async_context &ctx) noexcept -> std::error_code
Start the service on the context.
async_udp_service(socket_address< T > address) noexcept
Socket address constructor.
auto signal_handler(int signum) noexcept -> void
handle signals.
This namespace is for network services.
Definition async_context.hpp:31
An asynchronous execution context.
Definition async_context.hpp:34
io::execution::poll_multiplexer multiplexer_type
The io multiplexer type.
Definition async_context.hpp:38
exec::async_scope async_scope
Asynchronous scope type.
Definition async_context.hpp:36
signals
An enum of all valid async context signals.
Definition async_context.hpp:57
A read context.
Definition async_udp_service.hpp:84
std::array< std::byte, Size > buffer_type
The read buffer type.
Definition async_udp_service.hpp:86
buffer_type read_buffer
The read buffer.
Definition async_udp_service.hpp:101
io::socket::socket_message< sockaddr_in6 > socket_message
The socket message type.
Definition async_udp_service.hpp:98
io::socket::socket_address< sockaddr_in6 > socket_address
Socket address type.
Definition async_udp_service.hpp:92
socket_message msg
The read socket message.
Definition async_udp_service.hpp:105
std::span< std::byte > buffer
An assignable read buffer span.
Definition async_udp_service.hpp:103