TsgcWebSocketServer_HTTPAPIProperties › Options

Options Property

Bundles miscellaneous server behaviour flags: fragment handling, write timeouts, HTTP test pages and UTF-8 validation.

Syntax

public TsgcWSOptionsServer Options { get; set; }

Default Value

FragmentedMessages=frgOnlyBuffer, HTMLFiles=True, JavascriptFiles=True, WriteTimeOut=0

Remarks

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. RaiseDisconnectExceptions throws when a disconnection is caused by a protocol error. WriteTimeOut (milliseconds) only applies when Asynchronous is False: if a send takes longer than this value the request is cancelled and the connection is closed; 0 disables the check. A background thread scans the outstanding writes every WriteTimeoutInterval seconds (minimum 5, default 10). ValidateUTF8 rejects text messages containing invalid UTF-8. Software holds the HTTP Server header value.

Example


oServer = new TsgcWebSocketServer_HTTPAPI();
oServer.Options.FragmentedMessages = TwsFragmentedMessage.frgOnlyBuffer;
oServer.Options.ValidateUTF8 = true;
oServer.Options.HTMLFiles = false;
oServer.Active = true;

Back to Properties