TsgcWSPServer_DatasetEvents › OnConnect

OnConnect Event

Fires after a client completes the WebSocket handshake for this subprotocol.

Syntax

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

Default Value

Remarks

Raised once per accepted connection after the subprotocol sends its session identifier. When AutoSynchronize is True the metadata and snapshot are pushed immediately after this event returns, so this is the right place to inspect Connection.Guid, Connection.PeerIP or authorise the client before it receives any data. When a Broker is assigned the event is suppressed so the broker pipeline can own the handshake.

Example

procedure TForm1.oProtocolConnect(Connection: TsgcWSConnection);
begin
  Memo1.Lines.Add('connected: ' + Connection.Guid);
end;

Back to Events