TsgcWSPServer_Dataset › Events › OnConnect
Fires after a client completes the WebSocket handshake for this subprotocol.
property OnConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object
—
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.
procedure TForm1.oProtocolConnect(Connection: TsgcWSConnection);
begin
Memo1.Lines.Add('connected: ' + Connection.Guid);
end;