TsgcWSPClient_WAMP › Properties › Client
Verwijst naar de TsgcWebSocketClient die WAMP v1-frames vervoert via een WebSocket-verbinding.
property Client: TsgcWSComponent_WSClient read FClient write SetClient;
nil
Plaats een TsgcWebSocketClient op het formulier en wijs deze toe aan Client zodat WAMP v1-berichten als tekstframes worden verzonden binnen de WebSocket-sessie. De WebSocket-client beheert het transport (host, poort, TLS, proxy, HTTP-headers en subprotocolonderhandeling) terwijl deze component de WAMP RPC- en PubSub-laag hierbovenop implementeert. Na toewijzing start de WAMP-sessie automatisch wanneer de server bij voltooiing van de handshake een WELCOME-bericht verzendt. Onderhandel het wamp-subprotocol via WSClient.Specifications.WAMP := True (of stel dit in de subprotocollijst van de component in). Gebruik Broker in plaats daarvan wanneer u verbinding maakt via TCP.
WSClient := TsgcWebSocketClient.Create(nil);
WSClient.Host := 'wamp.example.com';
WSClient.Port := 80;
WSClient.Specifications.WAMP := True;
WAMP := TsgcWSPClient_WAMP.Create(nil);
WAMP.Client := WSClient;
WSClient.Active := True;