TsgcWebSocketHTTPServer › Properties › Options
Bundles miscellaneous server behaviour flags: fragment handling, timeouts, HTTP test pages and UTF-8 validation.
property Options: TsgcWSOptionsServer read FOptions write SetOptions;
FragmentedMessages=frgOnlyBuffer, HTMLFiles=True, JavascriptFiles=True, ReadTimeOut=10, WriteTimeOut=0
FragmentedMessages controls how fragmented frames are delivered: frgOnlyBuffer (default) buffers the message until complete and raises OnMessage/OnBinary; frgOnlyFragmented raises OnFragmented for every fragment; frgAll raises both. HTMLFiles and JavascriptFiles let the server serve the built-in browser test pages and JavaScript client (enabled by default). RaiseDisconnectExceptions throws when a disconnection is caused by a protocol error. 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. ValidateUTF8 rejects text messages containing invalid UTF-8 sequences (disabled by default). Software holds the value sent in the HTTP Server header.
oServer := TsgcWebSocketHTTPServer.Create(nil);
oServer.Options.FragmentedMessages := frgOnlyBuffer;
oServer.Options.ValidateUTF8 := true;
oServer.Options.HTMLFiles := false;
oServer.Active := true;