Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
srn_reactor_io_request_t Struct Reference

A submission, one request a fiber places on its channel. More...

#include <reactor.h>

Data Fields

srn_reactor_io_op_t op
int fd
 The descriptor the operation targets.
void * buf
 The transfer buffer for READ, WRITE, RECVFROM, and SENDTO, and the struct msghdr * for RECVMSG and SENDMSG.
size_t len
 The transfer length, in bytes, for READ, WRITE, RECVFROM, and SENDTO.
int64_t offset
 The file offset for SRN_REACTOR_IO_READ and SRN_REACTOR_IO_WRITE; -1 reads at the current position.
uint64_t deadline_ns
 The wake deadline for SRN_REACTOR_IO_SLEEP, on the monotonic clock, in nanoseconds.
void * fiber_data
 Opaque token, round tripped to the matching completion.
void * addr
 Socket address.
uint32_t addrlen
 Length of addr, the exact address length for SRN_REACTOR_IO_CONNECT and SRN_REACTOR_IO_SENDTO, the buffer capacity for SRN_REACTOR_IO_ACCEPT and SRN_REACTOR_IO_RECVFROM.
int flags
 Operation flags, the MSG_* flags for the datagram and message ops, the accept4 flags for SRN_REACTOR_IO_ACCEPT, and the requested readiness (EPOLLIN/EPOLLOUT) for SRN_REACTOR_IO_POLL.

Detailed Description

A submission, one request a fiber places on its channel.

The reactor copies it into the submission queue, so the struct itself need not outlive the call; a buffer it points at (buf) must stay valid until the operation completes.

Definition at line 113 of file reactor.h.

Field Documentation

◆ addr

void* srn_reactor_io_request_t::addr

Socket address.

Input for SRN_REACTOR_IO_CONNECT and SRN_REACTOR_IO_SENDTO (the peer to use); output for SRN_REACTOR_IO_ACCEPT and SRN_REACTOR_IO_RECVFROM (the peer that connected or sent), or null to ignore. A struct sockaddr *, kept as void * so this header stays free of socket headers.

Definition at line 139 of file reactor.h.

◆ addrlen

uint32_t srn_reactor_io_request_t::addrlen

Length of addr, the exact address length for SRN_REACTOR_IO_CONNECT and SRN_REACTOR_IO_SENDTO, the buffer capacity for SRN_REACTOR_IO_ACCEPT and SRN_REACTOR_IO_RECVFROM.

Definition at line 143 of file reactor.h.

◆ buf

void* srn_reactor_io_request_t::buf

The transfer buffer for READ, WRITE, RECVFROM, and SENDTO, and the struct msghdr * for RECVMSG and SENDMSG.

Definition at line 120 of file reactor.h.

◆ deadline_ns

uint64_t srn_reactor_io_request_t::deadline_ns

The wake deadline for SRN_REACTOR_IO_SLEEP, on the monotonic clock, in nanoseconds.

Definition at line 128 of file reactor.h.

◆ fd

int srn_reactor_io_request_t::fd

The descriptor the operation targets.

Unused by SRN_REACTOR_IO_NOP and SRN_REACTOR_IO_SLEEP.

Definition at line 117 of file reactor.h.

◆ fiber_data

void* srn_reactor_io_request_t::fiber_data

Opaque token, round tripped to the matching completion.

The reactor never reads it. For SRN_REACTOR_IO_CANCEL it names the target operation. The workers or the scheduler set their data here and expect it back on the completion counterpart

Definition at line 133 of file reactor.h.

◆ flags

int srn_reactor_io_request_t::flags

Operation flags, the MSG_* flags for the datagram and message ops, the accept4 flags for SRN_REACTOR_IO_ACCEPT, and the requested readiness (EPOLLIN/EPOLLOUT) for SRN_REACTOR_IO_POLL.

Definition at line 147 of file reactor.h.

◆ len

size_t srn_reactor_io_request_t::len

The transfer length, in bytes, for READ, WRITE, RECVFROM, and SENDTO.

Definition at line 122 of file reactor.h.

◆ offset

int64_t srn_reactor_io_request_t::offset

The file offset for SRN_REACTOR_IO_READ and SRN_REACTOR_IO_WRITE; -1 reads at the current position.

Definition at line 125 of file reactor.h.

◆ op

srn_reactor_io_op_t srn_reactor_io_request_t::op

Definition at line 114 of file reactor.h.


The documentation for this struct was generated from the following file: