eve.sys.windows.iocp
Supplemental Windows IOCP bindings not present in druntime.
Most IOCP and Winsock functionality is available via druntime's core.sys.windows.winbase and core.sys.windows.winsock2 modules. This module provides only the missing pieces needed by EVE's Layer 0.
Types 7
Buffer descriptor for Winsock overlapped I/O.
Used with WSARecv, WSASend, and related functions to describe data buffers for scatter/gather I/O operations.
Extended OVERLAPPED structure returned by GetQueuedCompletionStatusEx.
This structure is not present in druntime's winbase bindings.
ULONG_PTR lpCompletionKeyOVERLAPPED * lpOverlappedULONG_PTR InternalDWORD dwNumberOfBytesTransferredGUID structure for Winsock extension function lookups.
uint Data1ushort Data2ushort Data3ubyte[8] Data4Function pointer type for AcceptEx.
AcceptEx accepts a new connection, returns the local and remote addresses, and optionally receives the first block of data sent by the client.
Function pointer type for GetAcceptExSockaddrs.
Parses the output buffer from AcceptEx to extract local and remote addresses.
Function pointer type for ConnectEx.
ConnectEx establishes a connection asynchronously.
Winsock startup data structure.
ushort wVersionushort wHighVersionushort iMaxSocketsushort iMaxUdpDgchar * lpVendorInfochar[257] szDescriptionchar[129] szSystemStatusFunctions 15
BOOL GetQueuedCompletionStatusEx(
HANDLE CompletionPort,
OVERLAPPED_ENTRY * lpCompletionPortEntries,
ULONG ulCount,
ULONG * ulNumEntriesRemoved,
DWORD dwMilliseconds,
BOOL fAlertable,
)Dequeue multiple completion packets from an I/O completion port.BOOL CancelIoEx(HANDLE hFile, OVERLAPPED * lpOverlapped)Cancel pending I/O operations on a handle.int WSARecv(
SOCKET s,
WSABUF * lpBuffers,
DWORD dwBufferCount,
DWORD * lpNumberOfBytesRecvd,
DWORD * lpFlags,
OVERLAPPED * lpOverlapped,
void * lpCompletionRoutine
)Receive data on a socket using overlapped I/O.int WSASend(
SOCKET s,
WSABUF * lpBuffers,
DWORD dwBufferCount,
DWORD * lpNumberOfBytesSent,
DWORD dwFlags,
OVERLAPPED * lpOverlapped,
void * lpCompletionRoutine
)Send data on a socket using overlapped I/O.int WSARecvFrom(
SOCKET s,
WSABUF * lpBuffers,
DWORD dwBufferCount,
DWORD * lpNumberOfBytesRecvd,
DWORD * lpFlags,
sockaddr * lpFrom,
int * lpFromlen,
OVERLAPPED * lpOverlapped,
void * lpCompletionRoutine
)Receive a datagram and store the source address using overlapped I/O.int WSASendTo(
SOCKET s,
WSABUF * lpBuffers,
DWORD dwBufferCount,
DWORD * lpNumberOfBytesSent,
DWORD dwFlags,
const(sockaddr) * lpTo,
int iTolen,
OVERLAPPED * lpOverlapped,
void * lpCompletionRoutine
)Send a datagram to a specific destination using overlapped I/O.SOCKET WSASocketW(
int af,
int type,
int protocol,
void * lpProtocolInfo,
uint g,
DWORD dwFlags
)Create a socket with extended options.int WSAIoctl(
SOCKET s,
DWORD dwIoControlCode,
void * lpvInBuffer,
DWORD cbInBuffer,
void * lpvOutBuffer,
DWORD cbOutBuffer,
DWORD * lpcbBytesReturned,
OVERLAPPED * lpOverlapped,
void * lpCompletionRoutine
)Retrieve extension function pointer from Winsock.AcceptExFunc loadAcceptEx(SOCKET s) @trusted nothrow @nogcLoad AcceptEx function pointer from a socket.GetAcceptExSockaddrsFunc loadGetAcceptExSockaddrs(SOCKET s) @trusted nothrow @nogcLoad GetAcceptExSockaddrs function pointer from a socket.ConnectExFunc loadConnectEx(SOCKET s) @trusted nothrow @nogcLoad ConnectEx function pointer from a socket.ushort MAKEWORD(ubyte major, ubyte minor) pure @safe nothrow @nogcCreate a Winsock version request value.bool ensureWinsockInitialized() @trusted nothrow @nogcInitialize Winsock if not already initialized.Variables 20
INVALID_SOCKET = cast(SOCKET) ~ cast(size_t) 0Invalid socket sentinel value.
INFINITE = 0xFFFFFFFFInfinite timeout value.
ERROR_SUCCESS = 0Common error codes.
ERROR_IO_PENDING = 997ERROR_INVALID_HANDLE = 6ERROR_INVALID_PARAMETER = 87ERROR_NOT_FOUND = 1168ERROR_ALREADY_EXISTS = 183ERROR_IO_INCOMPLETE = 996WSA_IO_PENDING = 997Winsock error codes.
WSAECONNRESET = 10054WSAEDISCON = 10101WSA_FLAG_OVERLAPPED = 0x01Winsock socket creation flags.
SIO_GET_EXTENSION_FUNCTION_POINTER = 0xC8000006IOCTL code to retrieve extension function pointers.
GUID WSAID_ACCEPTEXGUID for AcceptEx function.
GUID WSAID_CONNECTEXGUID for ConnectEx function.
GUID WSAID_GETACCEPTEXSOCKADDRSGUID for GetAcceptExSockaddrs function.
SO_UPDATE_ACCEPT_CONTEXT = 0x700BSocket option to update accept context after AcceptEx.
SO_UPDATE_CONNECT_CONTEXT = 0x7010Socket option to update connect context after ConnectEx.
WINSOCK_VERSION_2_2 = 0x0202Winsock version 2.2 encoded.