TsgcWSPClient_sgc › Events › OnConnect
Fires after the WebSocket handshake completes and the sgc subprotocol is initialized.
property OnConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object
—
Use this event to issue Subscribe calls or to request session data through GetSession once the connection is ready. Connection carries the underlying TsgcWSConnection assigned to the sgc protocol instance.
procedure TForm1.oProtocolConnect(Connection: TsgcWSConnection);
begin
oProtocol.Subscribe('news');
end;