TsgcWebSocketClient › Events

TsgcWebSocketClient Events

Events you can handle, grouped by purpose, followed by the full alphabetical list.

Lifecycle

NameDescription
OnConnectFires when a WebSocket connection to the server has been successfully established.
OnDisconnectFires when the WebSocket connection has been dropped or closed.
OnErrorFires every time a WebSocket protocol error occurs on the connection.
OnHandshakeFires when the client HTTP handshake is being built so custom headers can be added.
OnExceptionFires whenever an unhandled exception is raised while processing the connection.
OnBeforeHeartBeatFires before each HeartBeat ping so the application can send a custom keep-alive message.
OnBeforeWatchDogFires before each WatchDog reconnection attempt so the application can adjust the target server or suppress the retry.
OnBeforeConnectFires before the client tries to connect to the server.

Data

NameDescription
OnMessageFires every time the server sends a text message to the client.
OnBinaryFires every time the server sends a binary message to the client.
OnFragmentedFires for every fragment received when Options.FragmentedMessages is frgAll or frgOnlyFragmented.

Reliability

NameDescription
OnLoadBalancerErrorFires when LoadBalancer is enabled and an error occurs while communicating with the Load Balancer Server.

Security

NameDescription
OnSSLGetHandlerFires before the SSL handler is created so a custom handler instance can be supplied.
OnSSLAfterCreateHandlerFires after the SSL handler has been created so its properties can be customized.
OnSSLVerifyPeerFires when VerifyCertificate is enabled so the application can accept or reject the server certificate.
OnSChannelVerifyPeerFires when SChannel is the TLS IOHandler so the application can verify the server certificate.

All Events (alphabetical)

NameDescription
OnBeforeConnectFires before the client tries to connect to the server.
OnBeforeHeartBeatFires before each HeartBeat ping so the application can send a custom keep-alive message.
OnBeforeWatchDogFires before each WatchDog reconnection attempt so the application can adjust the target server or suppress the retry.
OnBinaryFires every time the server sends a binary message to the client.
OnConnectFires when a WebSocket connection to the server has been successfully established.
OnDisconnectFires when the WebSocket connection has been dropped or closed.
OnErrorFires every time a WebSocket protocol error occurs on the connection.
OnExceptionFires whenever an unhandled exception is raised while processing the connection.
OnFragmentedFires for every fragment received when Options.FragmentedMessages is frgAll or frgOnlyFragmented.
OnHandshakeFires when the client HTTP handshake is being built so custom headers can be added.
OnLoadBalancerErrorFires when LoadBalancer is enabled and an error occurs while communicating with the Load Balancer Server.
OnMessageFires every time the server sends a text message to the client.
OnSChannelVerifyPeerFires when SChannel is the TLS IOHandler so the application can verify the server certificate.
OnSSLAfterCreateHandlerFires after the SSL handler has been created so its properties can be customized.
OnSSLGetHandlerFires before the SSL handler is created so a custom handler instance can be supplied.
OnSSLVerifyPeerFires when VerifyCertificate is enabled so the application can accept or reject the server certificate.