TsgcHTTPServer › Properties › Options
Bundles miscellaneous server behaviour flags: timeouts, built-in test pages and the HTTP Server header.
property Options: TsgcWSOptionsServer read FOptions write SetOptions;
ReadTimeOut=10, WriteTimeOut=0
ReadTimeOut is the polling interval in milliseconds (10 by default); WriteTimeOut is the time in milliseconds a socket write can make no progress before the stalled client is dropped, and applies on both Windows and POSIX (Linux), which helps defend against slow-read clients that would otherwise tie up a server thread. With the default 0, the IOCP and EPOLL IO handlers (see IOHandlerOptions) still drop a client whose writes make no progress for 30 seconds, plain or TLS, while the default IO handler waits with no limit, so set WriteTimeOut (for example 30000) when the server uses the default IO handler and sends to many clients. RaiseDisconnectExceptions throws when a disconnection is caused by a protocol error. Software holds the value sent in the HTTP Server header.
Options is the same type (TsgcWSOptionsServer) shared with TsgcWebSocketHTTPServer, so it also carries three WebSocket-only sub-properties that are inherited but inert on TsgcHTTPServer: FragmentedMessages and ValidateUTF8 govern how WebSocket frames are fragmented and validated, and since this component never receives a WebSocket frame, both have no effect. HTMLFiles and JavascriptFiles enable the built-in WebSocket browser test page and its JavaScript client; they are likewise inert here. Leave all four at their defaults.
oServer := TsgcHTTPServer.Create(nil);
oServer.Options.ReadTimeOut := 10;
oServer.Options.WriteTimeOut := 5000;
oServer.Active := true;