TsgcWebSocketServer_HTTPAPI › Properties › ReadBufferSize
Size in bytes of the receive buffer allocated per pending overlapped read against the http.sys request queue.
property ReadBufferSize: Integer read FReadBufferSize write FReadBufferSize;
16384 (16 KB)
Controls the size of the buffer allocated for each HttpReceiveHttpRequest / HttpReceiveRequestEntityBody call. The default of 16 KB is aligned with the MSDN HP sample and fits the common case of HTTP headers and small WebSocket frames. Raise the value if you expect most requests to carry large headers or if you push very large WebSocket frames and want to reduce the number of fragmented reads. Lower it if you have a high number of pre-posted receives (FineTune.OperatingMode=ompHighPerf) and want to reduce the reserved memory footprint (each pre-posted receive holds one buffer until it completes).
oServer := TsgcWebSocketServer_HTTPAPI.Create(nil);
oServer.Host := '127.0.0.1';
oServer.Port := 80;
// bump per-read buffer to 32 KB for large WebSocket frames
oServer.ReadBufferSize := 32768;
oServer.Active := true;