TsgcWSPServer_PresenceEvents › OnDisconnect

OnDisconnect Event

Fired when a client disconnects from the Presence protocol.

Syntax

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

Default Value

Remarks

Called on the server once a client connection is closed. Code carries the WebSocket close code. Note that member cleanup and channel unsubscription are signalled separately through OnRemoveMember and OnRemoveChannelMember.

Example

procedure TForm1.sgcWSPServer_Presence1Disconnect(Connection: TsgcWSConnection;
  Code: Integer);
begin
  Log('Presence client disconnected: ' + Connection.Guid + ' code=' + IntToStr(Code));
end;

Back to Events