Skip to content

DisconnectionError

Namespace: Signal.Bot

Full Name: Signal.Bot.DisconnectionError

Summary

Represents a disconnection event that occurred during WebSocket communication. Contains information about the disconnection type, close status, reason, and provides methods to control automatic reconnection and graceful closing behavior.

Properties

Event

The type of disconnection event that occurred (see DisconnectionEvent).

CloseStatus

The WebSocket close status code, if available.

CloseStatusDescription

Optional human-readable description of why the connection was closed.

SubProtocol

The WebSocket sub-protocol that was in use, if any.

Methods

#ctor

csharp
#ctor(Event, CloseStatus, CloseStatusDescription, SubProtocol, Exception)

Represents a disconnection event that occurred during WebSocket communication. Contains information about the disconnection type, close status, reason, and provides methods to control automatic reconnection and graceful closing behavior.

Parameters:

  • Event - The type of disconnection event that occurred (see DisconnectionEvent).
  • CloseStatus - The WebSocket close status code, if available.
  • CloseStatusDescription - Optional human-readable description of why the connection was closed.
  • SubProtocol - The WebSocket sub-protocol that was in use, if any.
  • Exception - The exception that caused the disconnection, if applicable.

CancelReconnection

csharp
CancelReconnection()

Cancels any automatic reconnection attempt that may be in progress or scheduled. Call this method to prevent the client from automatically reconnecting after a disconnection.

CancelClosing

csharp
CancelClosing()

Cancels the graceful closing process of the connection. Call this method to abort a connection close that is in progress.