// Create websocket client and set server options
oClient := TsgcWebSocketClient.Create(nil);
oClient.Host := '';
oClient.Port := 80;
// Create WAMP protocol and assign to websocket client
oWAMP := TsgcWSPClient_WAMP2.Create(nil);
oWAMP.Client := oClient;
// Handle WAMP methods
oWAMP.OnWAMPWelcome := OnWAMPWelcomeHandler;
oWAMP.OnWAMPGoodBye := OnWAMPGoodByeHandler;
// connect to server
oClient.Active := True;
// Subscribe to channel "myTopic"
oWAMP.Subscribe('myTopic');
// Send a message to all subscribers of channel "myTopic"
oWAMP.Publish('myTopic', 'Text message');
WAMP provides Unified Application Routing in an open WebSocket protocol that works with different languages.
Using WAMP you can build distributed systems out of application components which are loosely coupled and communicate in (soft) real-time.