TsgcWSPServer_Files › Events

TsgcWSPServer_Files Events

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

Lifecycle

NameDescription
OnConnectFired when a client successfully connects to the server.
OnDisconnectFired when a client disconnects from the server.
OnErrorFired when a protocol-level error is reported for a connection.
OnExceptionFired when an unhandled exception is raised while processing a connection.

Messaging

NameDescription
OnMessageFired when a plain text message is received from a client over the Files subprotocol.
OnBinaryFired when a raw binary frame is received from a client.
OnFragmentedFired when a fragmented WebSocket frame is received from a client.
OnRawMessageFired before the subprotocol parses a text message, allowing custom handling.

Subscriptions

NameDescription
OnBeforeSubscriptionFired before a client is subscribed to a channel, allowing the server to accept or reject the subscription.
OnSubscriptionFired after a client has been successfully subscribed to a channel.
OnUnSubscriptionFired after a client has been unsubscribed from a channel.

Receive

NameDescription
OnFileReceivedAuthorizationFired before an incoming file is accepted, allowing authorization and rename of the destination file.
OnFileReceivedFired when a file has been successfully received from a client.
OnFileReceivedFragmentFired when a fragment of a file is received; useful to report progress and allow cancellation.
OnFileReceivedErrorFired when an error occurs while receiving a file from a client.

Send

NameDescription
OnFileBeforeSentFired before a file is sent, allowing inspection and customization of the outgoing file metadata.
OnFileSentFragmentRequestFired when the receiver requests the next fragment under QoS Level 2; allows cancelling the transfer.
OnFileSentAcknowledgmentFired when the receiver acknowledges a sent fragment under QoS Level 1 or 2.
OnFileSentFired when a file has been successfully delivered to the client.
OnFileSentErrorFired when an error occurs while sending a file to a client.

All Events (alphabetical)

NameDescription
OnBeforeSubscriptionFired before a client is subscribed to a channel, allowing the server to accept or reject the subscription.
OnBinaryFired when a raw binary frame is received from a client.
OnConnectFired when a client successfully connects to the server.
OnDisconnectFired when a client disconnects from the server.
OnErrorFired when a protocol-level error is reported for a connection.
OnExceptionFired when an unhandled exception is raised while processing a connection.
OnFileBeforeSentFired before a file is sent, allowing inspection and customization of the outgoing file metadata.
OnFileReceivedFired when a file has been successfully received from a client.
OnFileReceivedAuthorizationFired before an incoming file is accepted, allowing authorization and rename of the destination file.
OnFileReceivedErrorFired when an error occurs while receiving a file from a client.
OnFileReceivedFragmentFired when a fragment of a file is received; useful to report progress and allow cancellation.
OnFileSentFired when a file has been successfully delivered to the client.
OnFileSentAcknowledgmentFired when the receiver acknowledges a sent fragment under QoS Level 1 or 2.
OnFileSentErrorFired when an error occurs while sending a file to a client.
OnFileSentFragmentRequestFired when the receiver requests the next fragment under QoS Level 2; allows cancelling the transfer.
OnFragmentedFired when a fragmented WebSocket frame is received from a client.
OnMessageFired when a plain text message is received from a client over the Files subprotocol.
OnRawMessageFired before the subprotocol parses a text message, allowing custom handling.
OnSubscriptionFired after a client has been successfully subscribed to a channel.
OnUnSubscriptionFired after a client has been unsubscribed from a channel.