TsgcWSPClient_WAMPPropriedades › Client

Client Property

Referencia o TsgcWebSocketClient que transporta quadros WAMP v1 por uma conexão WebSocket.

Sintaxe

property Client: TsgcWSComponent_WSClient read FClient write SetClient;

Valor Padrão

nil

Observações

Solte um TsgcWebSocketClient no formulário e atribua-o a Client para que as mensagens WAMP v1 trafeguem como frames de texto dentro da sessão WebSocket. O cliente WebSocket gerencia o transporte (host, porta, TLS, proxy, cabeçalhos HTTP e negociação de subprotocolo) enquanto este componente implementa a camada de RPC e PubSub do WAMP por cima. Após a atribuição, a sessão WAMP inicia automaticamente quando o servidor envia sua mensagem WELCOME na conclusão do handshake. Negocie o subprotocolo wamp via WSClient.Specifications.WAMP := True (ou defina-o na lista de subprotocolos do componente). Use Broker em vez disso ao conectar sobre TCP puro.

Exemplo


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;

Voltar para Propriedades