TsgcWSPServer_sgc › Events

TsgcWSPServer_sgc Events

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

Lifecycle

NameDescription
OnConnectFires after a client completes the WebSocket handshake for this subprotocol.
OnDisconnectFires when a client disconnects from the server.
OnErrorFires when the subprotocol reports a protocol-level error string for a connection.
OnExceptionFires when an unhandled exception is raised while processing a connection.

Messaging

NameDescription
OnMessageFires when a client sends a plain text message wrapped in the sgc envelope.
OnBinaryFires when a client sends a binary frame to the server.
OnFragmentedFires for each fragment of a fragmented WebSocket message received from a client.
OnRawMessageFires before a text message is decoded, allowing the handler to consume it.

PubSub

NameDescription
OnBeforeSubscriptionFires before a subscription is accepted; the handler can deny or authorise it.
OnSubscriptionFires after a client successfully subscribes to a channel.
OnUnSubscriptionFires after a client unsubscribes from a channel.
OnBeforePublishFires before a client publication is broadcast; the handler can rewrite or deny it.
OnNotificationFires when a client sends a JSON-RPC Notification (no Id, no reply expected).
OnAcknowledgmentFires when a client confirms receipt of a QoS Level 1 or Level 2 message.

RPC

NameDescription
OnRPCFires when a client invokes a JSON-RPC method on this server.
OnRPCAuthenticationFires when an RPC method is not on the allow-list, letting the handler authorise it.

All Events (alphabetical)

NameDescription
OnAcknowledgmentFires when a client confirms receipt of a QoS Level 1 or Level 2 message.
OnBeforePublishFires before a client publication is broadcast; the handler can rewrite or deny it.
OnBeforeSubscriptionFires before a subscription is accepted; the handler can deny or authorise it.
OnBinaryFires when a client sends a binary frame to the server.
OnConnectFires after a client completes the WebSocket handshake for this subprotocol.
OnDisconnectFires when a client disconnects from the server.
OnErrorFires when the subprotocol reports a protocol-level error string for a connection.
OnExceptionFires when an unhandled exception is raised while processing a connection.
OnFragmentedFires for each fragment of a fragmented WebSocket message received from a client.
OnMessageFires when a client sends a plain text message wrapped in the sgc envelope.
OnNotificationFires when a client sends a JSON-RPC Notification (no Id, no reply expected).
OnRawMessageFires before a text message is decoded, allowing the handler to consume it.
OnRPCFires when a client invokes a JSON-RPC method on this server.
OnRPCAuthenticationFires when an RPC method is not on the allow-list, letting the handler authorise it.
OnSubscriptionFires after a client successfully subscribes to a channel.
OnUnSubscriptionFires after a client unsubscribes from a channel.