TsgcWebSocketClientProperties › Options

Options Property

Customizes handshake headers and fine-tunes client behaviour such as fragmentation and UTF-8 validation.

Syntax

public TsgcWSOptionsClient Options { get; set; }

Default Value

FragmentedMessages=frgOnlyBuffer, RaiseDisconnectExceptions=True, ValidateUTF8=False, CleanDisconnect=False

Remarks

Exposes handshake and runtime settings: Parameters (extra GET parameters), Origin (custom Origin header) and FragmentedMessages which selects whether fragments are buffered (frgOnlyBuffer), reported individually (frgOnlyFragmented) or both (frgAll). RaiseDisconnectExceptions raises an exception on protocol-error disconnects, ValidateUTF8 verifies UTF-8 compliance of text frames and CleanDisconnect sends a close frame before dropping the TCP session.

Example


oClient = new TsgcWebSocketClient();
oClient.URL = "wss://www.esegece.com:2053";
oClient.Options.Parameters = "/ws/";
oClient.Options.ValidateUTF8 = true;
oClient.Options.CleanDisconnect = true;
oClient.Active = true;

Back to Properties