TsgcWebSocketServer › Events
Events you can handle, grouped by purpose, followed by the full alphabetical list.
| Name | Description |
|---|---|
| OnStartup | Fires after the server has started and is ready to accept connections. |
| OnShutdown | Fires after the server has stopped and no more connections are accepted. |
| OnTCPConnect | Fires after a client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected. |
| OnConnect | Fires every time a WebSocket connection is established with a client. |
| OnDisconnect | Fires every time a WebSocket connection with a client is dropped. |
| OnHandshake | Fires after the handshake is evaluated on the server side and before the response is sent. |
| OnError | Fires whenever a WebSocket protocol error occurs, such as a mal-formed handshake. |
| OnException | Fires whenever an unhandled exception is raised while processing a client connection. |
| OnUnknownProtocol | Fires when the first message does not match a known protocol so the connection can be accepted or rejected. |
| OnUnknownAuthentication | Fires when authentication is enabled and the authentication method is not recognized. |
| Name | Description |
|---|---|
| OnMessage | Fires every time a client sends a text message and it is received by the server. |
| OnBinary | Fires every time a client sends a binary message and it is received by the server. |
| OnFragmented | Fires when a fragment of a message is received (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented). |
| Name | Description |
|---|---|
| OnBeforeHeartBeat | Fires before each HeartBeat ping so the application can implement a custom keep-alive. |
| OnLoadBalancerConnect | Fires when the server connects to the Load Balancer Server. |
| OnLoadBalancerDisconnect | Fires when the server disconnects from the Load Balancer Server. |
| OnLoadBalancerError | Fires when an error occurs communicating with the Load Balancer Server. |
| Name | Description |
|---|---|
| OnAuthentication | Fires when authentication is enabled so the application can check user and password. |
| OnSSLGetHandler | Fires before the SSL handler is created so a custom handler instance can be supplied. |
| OnSSLAfterCreateHandler | Fires after the SSL handler has been created so its properties can be customized. |
| OnSSLALPNSelect | Fires during an ALPN-enabled handshake so the application can pick which protocol to negotiate. |
| OnSSLVerifyPeer | Fires when VerifyCertificate is enabled and the client presents a certificate to be accepted or rejected. |
| Name | Description |
|---|---|
| OnAuthentication | Fires when authentication is enabled so the application can check user and password. |
| OnBeforeHeartBeat | Fires before each HeartBeat ping so the application can implement a custom keep-alive. |
| OnBinary | Fires every time a client sends a binary message and it is received by the server. |
| OnConnect | Fires every time a WebSocket connection is established with a client. |
| OnDisconnect | Fires every time a WebSocket connection with a client is dropped. |
| OnError | Fires whenever a WebSocket protocol error occurs, such as a mal-formed handshake. |
| OnException | Fires whenever an unhandled exception is raised while processing a client connection. |
| OnFragmented | Fires when a fragment of a message is received (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented). |
| OnHandshake | Fires after the handshake is evaluated on the server side and before the response is sent. |
| OnLoadBalancerConnect | Fires when the server connects to the Load Balancer Server. |
| OnLoadBalancerDisconnect | Fires when the server disconnects from the Load Balancer Server. |
| OnLoadBalancerError | Fires when an error occurs communicating with the Load Balancer Server. |
| OnMessage | Fires every time a client sends a text message and it is received by the server. |
| OnShutdown | Fires after the server has stopped and no more connections are accepted. |
| OnSSLAfterCreateHandler | Fires after the SSL handler has been created so its properties can be customized. |
| OnSSLALPNSelect | Fires during an ALPN-enabled handshake so the application can pick which protocol to negotiate. |
| OnSSLGetHandler | Fires before the SSL handler is created so a custom handler instance can be supplied. |
| OnSSLVerifyPeer | Fires when VerifyCertificate is enabled and the client presents a certificate to be accepted or rejected. |
| OnStartup | Fires after the server has started and is ready to accept connections. |
| OnTCPConnect | Fires after a client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected. |
| OnUnknownAuthentication | Fires when authentication is enabled and the authentication method is not recognized. |
| OnUnknownProtocol | Fires when the first message does not match a known protocol so the connection can be accepted or rejected. |