template<
typename UDPStreamHandler, std::size_t Size = 64 * 1024UL>
class net::service::async_udp_service< UDPStreamHandler, Size >
A ServiceLike Async UDP Service.
- Template Parameters
-
| StreamHandler | The StreamHandler type that derives from async_udp_service. |
| Size | The socket read buffer size. (Default 64KiB). |
- Note
- The default constructor of async_udp_service is protected so async_udp_service can't be constructed without a stream handler (which would be UB).
async_udp_service is a CRTP base class compliant with the ServiceLike concept. It must be used with an inheriting CRTP specialization that defines what the service should do with bytes it reads off the wire. StreamHandler must define an operator() overload that eventually calls reader to restart the read loop. It also optionally specifies an initialize member that can be used to configure the service socket. See noop_service below for an example of how to specialize async_udp_service.
{
template <typename T>
{}
{
return {};
}
std::shared_ptr<read_context>
rctx,
std::span<const std::byte>
buf) ->
void
{
}
};
io::socket::socket_dialog< multiplexer_type > socket_dialog
The socket dialog type.
Definition async_tcp_service.hpp:86
io::socket::socket_address< T > socket_address
Templated socket address type.
Definition async_tcp_service.hpp:76
io::socket::socket_handle socket_handle
The socket handle type.
Definition async_tcp_service.hpp:84
service::async_context async_context
The async context type.
Definition async_tcp_service.hpp:78
A ServiceLike Async UDP Service.
Definition async_udp_service.hpp:66
io::socket::socket_address< T > socket_address
Templated socket address type.
Definition async_udp_service.hpp:69