TsgcWSPClient_sgcEvents › OnConnect

OnConnect Event

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

Syntax

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

Default Value

Remarks

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.

Example

procedure TForm1.oProtocolConnect(Connection: TsgcWSConnection);
begin
  oProtocol.Subscribe('news');
end;

Back to Events