eve.aio.windows.pipe
Async pipe primitives for Windows.
This module provides the Windows implementation of anonymous pipe primitives. On Windows, anonymous pipes created with CreatePipe do not support overlapped I/O directly, so this implementation uses named pipes with unique names for event loop integration.
Types 8
Pipe buffer configuration.
size_t bufferSizeSize of the internal read/write buffer.size_t highWaterMarkMaximum send queue size before backpressure is applied.size_t lowWaterMarkSend queue size at which backpressure is lifted and `onWritable` fires.Async pipe end wrapper.
Represents one end of a pipe - either the read or write end. Wraps a non-blocking pipe handle and integrates with the Layer 1 event loop for async read/write operations.
PipeEndState _statePipeEndState mutableState() @trustedInternal state for a pipe end using IOCP overlapped I/O.
This implementation uses Windows overlapped I/O with completion ports instead of polling. Each pipe end has its own OVERLAPPED structure and buffers that remain valid until the I/O completes.
The pipe integrates with the event loop via a wakeup watcher that is notified when IOCP completions arrive.
DataCallback onDataWritableCallback onWritableCloseCallback onCloseErrorCallback onErrorEventLoop * _loopReference to the event loop this pipe is registered with.Handle _handleThe underlying Windows pipe handle.PipeConfig _configPipe configuration (buffer sizes, etc.).bool _isReadEndWhether this is the read end (`true`) or write end (`false`).bool _readingPausedWhether reading is paused (read end only).bool _closeDeliveredWhether the close callback has been delivered.PipeState _pipeStateCurrent lifecycle state of the pipe.OVERLAPPED _readOverlappedOverlapped structure for pending read operations.OVERLAPPED _writeOverlappedOverlapped structure for pending write operations.ubyte[PIPE_READ_BUFFER_SIZE] _readBufferRead buffer — must remain valid during overlapped read.ubyte[PIPE_READ_BUFFER_SIZE] _writeBufferWrite buffer — must remain valid during overlapped write.bool _readInProgressWhether a read operation is currently in progress.bool _writeInProgressWhether a write operation is currently in progress.bool _awaitingWritableWhether we're waiting for backpressure to clear before notifying writable.size_t _pendingWriteLenNumber of bytes in the current pending write.ubyte[] _sendQueueQueue of data waiting to be written.void pipeCompletionCallback(void * context, OVERLAPPED * overlappedPtr,
size_t bytesTransferred, DWORD error) static @trusted nothrowStatic IOCP completion callback.void processReadCompletionData(DWORD bytesRead, DWORD error) @trusted nothrowProcess a completed read operation using IOCP completion data.void processWriteCompletionData(DWORD bytesWritten, DWORD error) @trusted nothrowProcess a completed write operation using IOCP completion data.void fail(int errorNumber) @trusted nothrow Transition the pipe to error state. Invokes the error callback and closes the pipe. Params: errorNumber = The error code to report.void closeInternal(PipeCloseReason reason, int errorNumber, bool invokeCallback) @trusted nothrowInternal close implementation.this(PipeConfig config)Functions 8
Variables 1
PIPE_READ_BUFFER_SIZE = 4096Size of the internal read/write buffer for overlapped I/O.