TsgcWSPClient_Dataset › Events › OnConnect
Fires after the WebSocket handshake completes and the Dataset subprotocol is initialized.
property OnConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object
—
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.
procedure TForm1.oProtocolConnect(Connection: TsgcWSConnection);
begin
oProtocol.Synchronize;
end;