TsgcWebSocketClientProperties › ConnectTimeout

ConnectTimeout Property

Maximum time in milliseconds the client waits for the TCP connection to be established.

Syntax

public int ConnectTimeout { get; set; }

Default Value

0

Remarks

A value of 0 means use the underlying socket's default behaviour (no explicit timeout). When a positive value is set, the client aborts the connection attempt if the remote peer has not accepted the socket within the specified number of milliseconds and raises an error. ConnectTimeout only applies to the initial TCP and TLS handshake; subsequent read and write operations use ReadTimeout and WriteTimeout.

Example


oClient = new TsgcWebSocketClient();
oClient.URL = "wss://www.esegece.com:2053";
oClient.ConnectTimeout = 5000;
oClient.Active = true;

Back to Properties