25#ifndef JOIN_CORE_IO_OPERATION_HPP
26#define JOIN_CORE_IO_OPERATION_HPP
29#include <sys/socket.h>
35 class CompletionHandler;
156 bool linked =
false) noexcept;
168 bool linked = false) noexcept;
181 bool linked = false) noexcept;
221 bool linked =
false) noexcept;
233 bool linked = false) noexcept;
264 bool linked =
false) noexcept;
277 bool linked = false) noexcept;
292 int fd () const noexcept;
completion handler interface class.
Definition proactor.hpp:75
Definition acceptor.hpp:32
payload for accept.
Definition io_operation.hpp:73
socklen_t * addrlen
peer address length.
Definition io_operation.hpp:81
int fd
file descriptor.
Definition io_operation.hpp:75
int flags
accept flags.
Definition io_operation.hpp:84
sockaddr * addr
peer address.
Definition io_operation.hpp:78
payload for connect.
Definition io_operation.hpp:103
const sockaddr * addr
remote address.
Definition io_operation.hpp:108
socklen_t addrlen
address length.
Definition io_operation.hpp:111
int fd
file descriptor.
Definition io_operation.hpp:105
payload for sendmsg / recvmsg.
Definition io_operation.hpp:200
int flags
sendmsg / recvmsg flags.
Definition io_operation.hpp:208
msghdr * msg
message header.
Definition io_operation.hpp:205
int fd
file descriptor.
Definition io_operation.hpp:202
payload for read / read fixed / write / write fixed.
Definition io_operation.hpp:129
unsigned long len
number of bytes to transfer.
Definition io_operation.hpp:137
bool fixed
use registered buffer (ignored with reactor backend).
Definition io_operation.hpp:143
uint16_t index
registered buffer index (ignored with reactor backend).
Definition io_operation.hpp:140
int fd
file descriptor.
Definition io_operation.hpp:131
void * buf
buffer.
Definition io_operation.hpp:134
payload for recv / send.
Definition io_operation.hpp:239
int fd
file descriptor.
Definition io_operation.hpp:241
unsigned long len
number of bytes to transfer.
Definition io_operation.hpp:247
int flags
send / recv flags.
Definition io_operation.hpp:250
void * buf
buffer.
Definition io_operation.hpp:244
Describes a single asynchronous operation submitted to the Proactor.
Definition io_operation.hpp:41
bool linked
link this SQE to the next one (next executes only if this succeeds, io_uring only).
Definition io_operation.hpp:304
static IoOperation makeWrite(int fd, const void *buf, uint32_t len, CompletionHandler *handler, bool linked=false) noexcept
build a regular write operation.
Definition io_operation.cpp:87
State state
operation state.
Definition io_operation.hpp:298
static IoOperation makeSendmsg(int fd, const msghdr *msg, int flags, CompletionHandler *handler, bool linked=false) noexcept
build a send-message operation.
Definition io_operation.cpp:160
static IoOperation makeConnect(int fd, const sockaddr *addr, socklen_t addrlen, CompletionHandler *handler) noexcept
build a connect operation.
Definition io_operation.cpp:53
static IoOperation makeSend(int fd, const void *buf, uint32_t len, int flags, CompletionHandler *handler, bool linked=false) noexcept
build a send operation.
Definition io_operation.cpp:195
static IoOperation makeReadFixed(int fd, void *buf, uint32_t len, uint16_t index, CompletionHandler *handler, bool linked=false) noexcept
build a fixed-buffer read operation.
Definition io_operation.cpp:106
static IoOperation makeWriteFixed(int fd, const void *buf, uint32_t len, uint16_t index, CompletionHandler *handler, bool linked=false) noexcept
build a fixed-buffer write operation.
Definition io_operation.cpp:125
uint32_t index
index of this operation in the proactor pending ops (io_uring only).
Definition io_operation.hpp:301
static IoOperation makeRead(int fd, void *buf, uint32_t len, CompletionHandler *handler, bool linked=false) noexcept
build a regular read operation.
Definition io_operation.cpp:69
static IoOperation makeAccept(int fd, sockaddr *addr, socklen_t *addrlen, int flags, CompletionHandler *handler) noexcept
build an accept operation.
Definition io_operation.cpp:36
Data data
operation code specific payload.
Definition io_operation.hpp:310
State
operation lifecycle state.
Definition io_operation.hpp:46
static IoOperation makeRecvmsg(int fd, msghdr *msg, int flags, CompletionHandler *handler, bool linked=false) noexcept
build a receive-message operation.
Definition io_operation.cpp:144
CompletionHandler * handler
handler to dispatch to on completion.
Definition io_operation.hpp:307
static IoOperation makeRecv(int fd, void *buf, uint32_t len, int flags, CompletionHandler *handler, bool linked=false) noexcept
build a receive operation.
Definition io_operation.cpp:177
uint8_t code
operation code.
Definition io_operation.hpp:295
Opcode
operation code.
Definition io_operation.hpp:56
int fd() const noexcept
return the file descriptor associated with this operation.
Definition io_operation.cpp:213
Definition io_operation.hpp:280
RwData rw
Definition io_operation.hpp:283
MsgData msg
Definition io_operation.hpp:284
AcceptData accept
Definition io_operation.hpp:281
StreamData stream
Definition io_operation.hpp:285
ConnectData connect
Definition io_operation.hpp:282