// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #if ZEN_WITH_HTTPSYS # define _WINSOCKAPI_ # include # include namespace zen { /** * Tagged OVERLAPPED wrapper for http.sys IOCP dispatch * * Both HttpSysTransaction (for normal HTTP request I/O) and WsHttpSysConnection * (for WebSocket read/write) embed this struct. The single IoCompletionCallback * bound to the request queue uses the ContextType tag to dispatch to the correct * handler. * * The Overlapped member must be first so that CONTAINING_RECORD works to recover * the HttpSysIoContext from the OVERLAPPED pointer provided by the threadpool. */ struct HttpSysIoContext { OVERLAPPED Overlapped{}; enum class Type : uint8_t { kTransaction, kWebSocketRead, kWebSocketWrite, } ContextType = Type::kTransaction; void* Owner = nullptr; }; } // namespace zen #endif // ZEN_WITH_HTTPSYS