|
join 1.0
lightweight network framework library
|
Describes a single asynchronous operation submitted to the Proactor. More...
#include <io_operation.hpp>

Classes | |
| struct | AcceptData |
| payload for accept. More... | |
| struct | ConnectData |
| payload for connect. More... | |
| union | Data |
| struct | MsgData |
| payload for sendmsg / recvmsg. More... | |
| struct | PollData |
| payload for poll. More... | |
| struct | RwData |
| payload for read / read fixed / write / write fixed. More... | |
| struct | StreamData |
| payload for recv / send. More... | |
Public Types | |
| enum class | State : uint8_t { Idle , Submitted , Busy , Suspended } |
| operation lifecycle state. More... | |
| enum class | Opcode : uint8_t { Poll , Accept , Connect , Read , Write , ReadFixed , WriteFixed , RecvMsg , SendMsg , Recv , Send } |
| operation code. More... | |
Public Member Functions | |
| IoOperation ()=default | |
| default constructor. | |
| IoOperation (const IoOperation &other) noexcept | |
| copy constructor. | |
| IoOperation & | operator= (const IoOperation &other) noexcept |
| copy assignment operator. | |
| int | fd () const noexcept |
| return the file descriptor associated with this operation. | |
Static Public Member Functions | |
| static IoOperation | makePoll (int fd, uint32_t events, CompletionHandler *handler) noexcept |
| build a poll operation. | |
| static IoOperation | makePollMulti (int fd, uint32_t events, CompletionHandler *handler) noexcept |
| build a multishot poll operation, staying armed until cancelled or failed. | |
| static IoOperation | makeAccept (int fd, sockaddr *addr, socklen_t *addrlen, int flags, CompletionHandler *handler) noexcept |
| build an accept operation. | |
| static IoOperation | makeAcceptMulti (int fd, int flags, CompletionHandler *handler) noexcept |
| build a multishot accept operation. | |
| static IoOperation | makeConnect (int fd, const sockaddr *addr, socklen_t addrlen, CompletionHandler *handler) noexcept |
| build a connect operation. | |
| static IoOperation | makeRead (int fd, void *buf, uint32_t len, CompletionHandler *handler, bool linked=false) noexcept |
| build a regular read operation. | |
| static IoOperation | makeWrite (int fd, const void *buf, uint32_t len, CompletionHandler *handler, bool linked=false) noexcept |
| build a regular write operation. | |
| 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. | |
| 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. | |
| static IoOperation | makeRecvmsg (int fd, msghdr *msg, int flags, CompletionHandler *handler, bool linked=false) noexcept |
| build a receive-message operation. | |
| static IoOperation | makeRecvmsgMulti (int fd, uint16_t group, msghdr *msg, int flags, CompletionHandler *handler) noexcept |
| build a multishot receive-message operation. | |
| static IoOperation | makeSendmsg (int fd, const msghdr *msg, int flags, CompletionHandler *handler, bool linked=false) noexcept |
| build a send-message operation. | |
| static IoOperation | makeRecv (int fd, void *buf, uint32_t len, int flags, CompletionHandler *handler, bool linked=false) noexcept |
| build a receive operation. | |
| static IoOperation | makeRecvMulti (int fd, uint16_t group, int flags, CompletionHandler *handler) noexcept |
| build a multishot receive operation. | |
| static IoOperation | makeSend (int fd, const void *buf, uint32_t len, int flags, CompletionHandler *handler, bool linked=false) noexcept |
| build a send operation. | |
Public Attributes | |
| uint8_t | code = 0 |
| operation code. | |
| std::atomic< State > | state {State::Idle} |
| operation state. | |
| State | resume {State::Idle} |
| state to restore when the current hold is released. | |
| uint32_t | index = 0 |
| index of this operation in the proactor pending ops (io_uring only). | |
| bool | linked = false |
| link this SQE to the next one (next executes only if this succeeds, io_uring only). | |
| bool | multishot = false |
| rearm the operation after each completion. | |
| bool | more = false |
| true while a multishot operation stays armed. | |
| uint16_t | group = 0 |
| provided buffer group. | |
| CompletionHandler * | handler = nullptr |
| handler to dispatch to on completion. | |
| Data | data = {} |
| operation code specific payload. | |
| IoRingBuffer * | ring = nullptr |
| buffer ring bound to this operation. | |
Describes a single asynchronous operation submitted to the Proactor.
|
strong |
operation code.
|
strong |
|
default |
default constructor.
|
noexcept |
copy constructor.
| other | other object to copy. |
|
noexcept |
return the file descriptor associated with this operation.
|
staticnoexcept |
build an accept operation.
| fd | listening socket file descriptor. |
| addr | peer address. |
| addrlen | peer address length. |
| flags | accept flags. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a multishot accept operation.
| fd | listening socket file descriptor. |
| flags | accept flags. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a connect operation.
| fd | socket file descriptor. |
| addr | remote address. |
| addrlen | remote address length. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a poll operation.
| fd | file descriptor to watch. |
| events | requested events, POLLIN or POLLOUT. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a multishot poll operation, staying armed until cancelled or failed.
| fd | file descriptor to watch. |
| events | requested events, POLLIN or POLLOUT. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a regular read operation.
| fd | file descriptor to read from. |
| buf | destination buffer. |
| len | number of bytes to read. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a fixed-buffer read operation.
| fd | file descriptor to read from. |
| buf | destination buffer. |
| len | number of bytes to read. |
| index | registered buffer index. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a receive operation.
| fd | socket file descriptor. |
| buf | destination buffer. |
| len | number of bytes to receive. |
| flags | recv flags. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a receive-message operation.
| fd | socket file descriptor. |
| msg | message header. |
| flags | recv flags. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a multishot receive-message operation.
| fd | socket file descriptor. |
| group | provided buffer group, the selected buffer is only valid during the callback. |
| msg | message header. |
| flags | recv flags. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a multishot receive operation.
| fd | socket file descriptor. |
| group | provided buffer group, the selected buffer is only valid during the callback. |
| flags | recv flags. |
| handler | handler to notify on completion. |
|
staticnoexcept |
build a send operation.
| fd | socket file descriptor. |
| buf | source buffer. |
| len | number of bytes to send. |
| flags | send flags. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a send-message operation.
| fd | socket file descriptor. |
| msg | message header. |
| flags | send flags. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a regular write operation.
| fd | file descriptor to write to. |
| buf | source buffer. |
| len | number of bytes to write. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
staticnoexcept |
build a fixed-buffer write operation.
| fd | file descriptor to write to. |
| buf | source buffer. |
| len | number of bytes to write. |
| index | registered buffer index. |
| handler | handler to notify on completion. |
| linked | link this SQE to the next one (io_uring only). |
|
noexcept |
copy assignment operator.
| other | other object to copy. |
| uint8_t join::IoOperation::code = 0 |
operation code.
| Data join::IoOperation::data = {} |
operation code specific payload.
| uint16_t join::IoOperation::group = 0 |
provided buffer group.
| CompletionHandler* join::IoOperation::handler = nullptr |
handler to dispatch to on completion.
| uint32_t join::IoOperation::index = 0 |
index of this operation in the proactor pending ops (io_uring only).
| bool join::IoOperation::linked = false |
link this SQE to the next one (next executes only if this succeeds, io_uring only).
| bool join::IoOperation::more = false |
true while a multishot operation stays armed.
| bool join::IoOperation::multishot = false |
rearm the operation after each completion.
| State join::IoOperation::resume {State::Idle} |
state to restore when the current hold is released.
| IoRingBuffer* join::IoOperation::ring = nullptr |
buffer ring bound to this operation.
| std::atomic<State> join::IoOperation::state {State::Idle} |
operation state.