sgcWebSockets Protocol WAMP - Enterprise for Delphi/CBuilder/FPC
- Brand: esegece
- Product Code: sgcWebSockets Protocol
- Availability: In Stock
Remote Procedure Call (RPC)
PubSub
Subscribers subscribe to topics they are interested in with Brokers. Publishers initiate publication first at Brokers. Brokers route events incoming from Publishers to Subscribers that are subscribed to respective topics.
Create Connection
// 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
// Subscribe to channel "myTopic"
oWAMP.Subscribe('myTopic');
Publish
// Send a message to all subscribers of channel "myTopic"
oWAMP.Publish('myTopic', 'Text message');
Tags: esegece, sgcWebSockets Protocol, Delphi, CBuilder, sgcWebSockets Protocol WAMP - Enterprise for Delphi/CBuilder/FPC