TsgcWSPClient_PresenceEvents › OnSession

OnSession Event

Fires when the server returns the session id assigned to this member.

Syntax

property OnSession: TsgcWSPresenceSessionEvent;
// TsgcWSPresenceSessionEvent = procedure(Connection: TsgcWSConnection; Session: string) of object

Default Value

Remarks

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.

Example

procedure TForm1.oPresenceSession(Connection: TsgcWSConnection; Session: string);
begin
  Memo1.Lines.Add('Session: ' + Session);
  oPresence.Subscribe('chat');
end;

Back to Events