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 Proactor>
62 template <
class Protocol,
class Proactor>
66 using Socket =
typename Protocol::Socket;
81 socklen_t
remoteLen =
sizeof (
struct sockaddr_storage);
87 template <
class Protocol,
class Proactor>
93 using Read =
Function<void (
const std::error_code&,
const char*,
size_t,
bool), 16>;
117 template <
class Protocol,
class Proactor>
145 template <
class... Ops>
148 static_assert (
sizeof...(Ops) > 0,
"traits must describe at least one operation");
151 static constexpr size_t maxSize = std::max ({
sizeof (Ops)...});
157 template <
class Protocol,
class Proactor>
Definition acceptor.hpp:32
asynchronous accept operation.
Definition async_operation.hpp:64
typename Protocol::Socket Socket
Definition async_operation.hpp:66
Accept acceptHandler
handler invoked on completion.
Definition async_operation.hpp:75
Endpoint remote
remote endpoint.
Definition async_operation.hpp:78
socklen_t remoteLen
remote address length.
Definition async_operation.hpp:81
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:72
typename Protocol::Endpoint Endpoint
Definition async_operation.hpp:65
asynchronous operation traits.
Definition async_operation.hpp:147
static constexpr size_t maxSize
size of the largest asynchronous operation.
Definition async_operation.hpp:151
asynchronous read operation.
Definition async_operation.hpp:89
typename Protocol::Endpoint Endpoint
Definition async_operation.hpp:90
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:99
iovec iov
read scatter gather entry.
Definition async_operation.hpp:111
ReadFrom readFromHandler
handler invoked on completion, reporting the endpoint the data are coming from.
Definition async_operation.hpp:105
msghdr msg
read message header.
Definition async_operation.hpp:108
Read readHandler
handler invoked on completion.
Definition async_operation.hpp:102
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:119
Write writeHandler
handler invoked on completion.
Definition async_operation.hpp:133
msghdr msg
write message header.
Definition async_operation.hpp:136
iovec iov
write scatter gather entry.
Definition async_operation.hpp:139
Connect connectHandler
handler invoked on connection completion.
Definition async_operation.hpp:130
IoOperation op
operation submitted to the proactor.
Definition async_operation.hpp:127
Describes a single asynchronous operation submitted to the Proactor.
Definition io_operation.hpp:47