TsgcWSPClient_DatasetEvents › OnConnect

OnConnect Event

Fires after the WebSocket handshake completes and the Dataset subprotocol is initialized.

Syntax

property OnConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object

Default Value

Remarks

Use this event to issue Subscribe calls, trigger a Synchronize, or request session data through GetSession once the connection is ready. Connection carries the underlying TsgcWSConnection assigned to the Dataset protocol instance. If AutoSubscribe is True, Subscribe_all has already been invoked before this handler runs.

Example

procedure TForm1.oProtocolConnect(Connection: TsgcWSConnection);
begin
  oProtocol.Synchronize;
end;

Back to Events