|
KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
|


Go to the source code of this file.
Data Structures | |
| struct | KlAsyncOp |
| An in-flight async operation that suspends a connection. More... | |
Typedefs | |
| typedef struct KlServer | KlServer |
| typedef struct KlConn | KlConn |
| typedef struct KlAsyncOp | KlAsyncOp |
| typedef void(* | KlAsyncFn) (KlAsyncOp *op, void *user_data) |
| Callback for async operation lifecycle events. | |
Functions | |
| int | kl_async_suspend (KlServer *s, KlConn *conn, KlAsyncOp *op) |
| Suspend a connection for an async operation. | |
| void | kl_async_complete (KlServer *s, KlAsyncOp *op) |
| Complete an async operation and resume the connection. | |
| typedef void(* KlAsyncFn) (KlAsyncOp *op, void *user_data) |
Callback for async operation lifecycle events.
| op | The async operation. |
| user_data | Opaque pointer from op->user_data. |
Suspend a connection for an async operation.
Sets conn->state to KL_CONN_SUSPENDED, removes the client FD from the event loop, and adds the op to the server's active ops list. The connection is exempt from idle timeouts while suspended.
| s | Server instance. |
| conn | Connection to suspend. |
| op | Caller-owned async op (must remain valid until completion). |
Complete an async operation and resume the connection.
Calls op->on_resume, re-registers the client FD in the event loop, and drives the connection state machine forward (try immediate send, transition to SENDING/READING/CLOSED as appropriate).
If on_resume triggers another suspension (e.g. handler yields again), the new suspension takes effect and this function is a no-op after the on_resume call.
| s | Server instance. |
| op | Async op to complete (removed from active list). |