25#ifndef JOIN_CORE_ASYNC_OPERATION_HPP
26#define JOIN_CORE_ASYNC_OPERATION_HPP
34#include <system_error>
38#include <sys/socket.h>
46 template <
class Protocol,
class ProactorType>
62 template <
class Protocol,
class ProactorType>
66 using Socket =
typename Protocol::Socket;
81 socklen_t
remoteLen =
sizeof (
struct sockaddr_storage);
87 template <
class Protocol,
class ProactorType>
93 using Read =
Function<void (
const std::error_code&,
const char*,
size_t,
bool), 16>;
97 Function<void (
const std::error_code&,
const char*,
size_t,
const Endpoint&,
const char*,
size_t,
bool),
119 template <
class Protocol,
class ProactorType>
147 template <
class... Ops>
150 static_assert (
sizeof...(Ops) > 0,
"traits must describe at least one operation");
153 static constexpr size_t maxSize = std::max ({
sizeof (Ops)...});
159 template <
class Protocol,
class ProactorType>
Definition acceptor.hpp:32
asynchronous accept operation.
Definition async_operation.hpp:64
typename Protocol::Endpoint Endpoint
Definition async_operation.hpp:65
Endpoint remote
remote endpoint.
Definition async_operation.hpp:78
Accept acceptHandler
handler invoked on completion.
Definition async_operation.hpp:75
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:72
socklen_t remoteLen
remote address length.
Definition async_operation.hpp:81
typename Protocol::Socket Socket
Definition async_operation.hpp:66
asynchronous operation traits.
Definition async_operation.hpp:149
static constexpr size_t maxSize
size of the largest asynchronous operation.
Definition async_operation.hpp:153
asynchronous read operation.
Definition async_operation.hpp:89
typename Protocol::Endpoint Endpoint
Definition async_operation.hpp:90
ReadFrom readFromHandler
handler invoked on completion, reporting the endpoint the data are coming from.
Definition async_operation.hpp:107
Read readHandler
handler invoked on completion.
Definition async_operation.hpp:104
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:101
msghdr msg
read message header.
Definition async_operation.hpp:110
iovec iov
read scatter gather entry.
Definition async_operation.hpp:113
asynchronous wait operation.
Definition async_operation.hpp:48
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:53
Wait waitHandler
handler invoked on completion.
Definition async_operation.hpp:56
asynchronous write operation.
Definition async_operation.hpp:121
Connect connectHandler
handler invoked on connection completion.
Definition async_operation.hpp:132
msghdr msg
write message header.
Definition async_operation.hpp:138
Write writeHandler
handler invoked on completion.
Definition async_operation.hpp:135
iovec iov
write scatter gather entry.
Definition async_operation.hpp:141
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:129
Describes a single asynchronous operation submitted to the Proactor.
Definition io_operation.hpp:48