TsgcWSPClient_WAMPEvents › OnWelcome

OnWelcome Event

Fires when the server's WELCOME frame has been received, signalling that the WAMP session is fully open and ready for RPC and PubSub calls.

Syntax

property OnWelcome: TsgcWSWelcomeEvent;
// TsgcWSWelcomeEvent = procedure(Connection: TsgcWSConnection; SessionId: Int64; Details: string) of object

Default Value

Remarks

Delivered in response to a WAMP v1 WELCOME frame (type id 0) issued by the server immediately after the WebSocket handshake. SessionId is the server-assigned identifier for this session; include it when filing support tickets or when coordinating exclude/eligible lists on Publish. Details carries the server protocol version and identification (for example "Autobahn/0.9.1") so the client can adapt behaviour to peer-specific quirks. This event is the correct place to (re-)register Prefix aliases and to Subscribe to topics, because WAMP v1 discards all subscription and prefix state when the session ends.

Example


procedure TForm1.WAMPWelcome(Connection: TsgcWSConnection;
  SessionId: Int64; Details: string);
begin
  Memo1.Lines.Add(Format('session %d opened (%s)', [SessionId, Details]));
  WAMP.Prefix('calc', 'http://example.com/simple/calc#');
  WAMP.Subscribe('http://example.com/chat#lobby');
end;

Back to Events