TsgcWSPClient_sgcEvents › OnDisconnect

OnDisconnect Event

Fires when the connection is closed, reporting the close code.

Syntax

property OnDisconnect: TsgcWSDisconnectEvent;
// TsgcWSDisconnectEvent = procedure(Connection: TsgcWSConnection; Code: Integer) of object

Default Value

Remarks

Raised when the client-side disconnects or when the server closes the session. Code is the WebSocket close status (for example 1000 for normal closure). The QoS timer and RPC list are cleared before this handler fires.

Example

procedure TForm1.oProtocolDisconnect(Connection: TsgcWSConnection; Code: Integer);
begin
  Memo1.Lines.Add(Format('disconnected: %d', [Code]));
end;

Back to Events