Preliminary. ThinkMeta ConcurrentTasks and this documentation are preliminary; everything is subject to change.

API reference / Async I/O

AsyncSocketIoRequest class

The state of one asynchronous socket operation.

On this page
Use
import ThinkMeta.ConcurrentTasks.AsyncIo.AsyncSocketIoRequest;
Namespace
ThinkMeta::ConcurrentTasks::AsyncIo
Inherits
AsyncIoRequest
Platforms
Windows, Linux

Syntax

class AsyncSocketIoRequest : public AsyncIoRequest<_SocketErrorCode>

Remarks

Holds its OVERLAPPED (Windows) or IoRequest (elsewhere), the bytes transferred and the error code it completed with (Windows::WinsockErrorCode on Windows, an errno elsewhere). Not usable on its own: use a Waitable variant below (WaitableAsyncSocketIoRequest, WaitableAsyncSocketIoRequest_s), or an own request type that reacts to the completion in RequestCompleted. The owner keeps the request alive and in place from the start of the operation until RequestCompleted has run; it can be reused for another operation after AsyncIoRequest::Reset.

See also

AsyncSocket

Constructors

AsyncSocketIoRequestprotected

Creates an idle request.

Syntax

AsyncSocketIoRequest() noexcept = default;

Remarks

Zeroed OVERLAPPED, no error, 0 bytes.

Methods

RequestCompleted

Records the operation's result.

Syntax

void RequestCompleted(
    CompletionError error,
    ByteCount bytesTransferred
) noexcept override;

Parameters

errorCompletionError
The operation's own error code (Win32/WSA on Windows, errno elsewhere); 0 on success.
bytesTransferredByteCount
Bytes the operation transferred; for an accept outside Windows, the new socket's descriptor.

Remarks

Called exactly once per operation: on the starting thread when the operation completed synchronously (Windows only), otherwise on the core's I/O thread. Completion handling in an own request type must be short and must not block or suspend.

Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).