TsgcWSPClient_Presence › Events › OnSession
Fires when the server returns the session id assigned to this member.
property OnSession: TsgcWSPresenceSessionEvent;
// TsgcWSPresenceSessionEvent = procedure(Connection: TsgcWSConnection; Session: string) of object
—
Fires once per connection, right after the server has registered this client as a member and assigned a session id. The Presence client uses the session as the member id on every outbound message, so subsequent Subscribe, Publish and Invite calls are safe from this point. Share Session with peers so they can target this member through Invite.
procedure TForm1.oPresenceSession(Connection: TsgcWSConnection; Session: string);
begin
Memo1.Lines.Add('Session: ' + Session);
oPresence.Subscribe('chat');
end;