WAMP Protocol

Web Application Messaging Protocol — unified Remote Procedure Calls (RPC) and Publish/Subscribe (PubSub) in a single protocol over WebSocket.

TsgcWSPClient_WAMP

WAMP v1 subprotocol client — PubSub plus typed Remote Procedure Calls over WebSocket. The WAMP2 router-side variant lives in TsgcWSPClient_WAMP2.

Classe do componente

TsgcWSPClient_WAMP

Protocolo

WAMP v1 (PubSub + RPC)

Plataformas

Windows, macOS, Linux, iOS, Android

Edição

Professional / Enterprise

Drop the component, set a few properties, go

Pair with a TsgcWebSocketClient, hook OnWelcome, then Prefix / Subscribe / Publish / Call.

uses
  sgcWebSocket, sgcWebSocket_Protocol_WAMP_Client;

var
  WSClient: TsgcWebSocketClient;
  WAMP: TsgcWSPClient_WAMP;
begin
  WSClient := TsgcWebSocketClient.Create(nil);
  WSClient.Host := 'router.example.com';
  WSClient.Port := 8080;

  WAMP := TsgcWSPClient_WAMP.Create(nil);
  WAMP.Client := WSClient;

  WAMP.OnWelcome    := WAMPWelcome;
  WAMP.OnEvent      := WAMPEvent;
  WAMP.OnCallResult := WAMPCallResult;

  WSClient.Active := True;
end;

procedure TForm1.WAMPWelcome(Connection: TsgcWSConnection;
  SessionId, ProtocolVersion, ServerIdent: string);
begin
  WAMP.Prefix('app', 'http://example.com/');
  WAMP.Subscribe('app:news');
  WAMP.Publish('app:news', 'hello');
  WAMP.Call('call-1', 'app:rpc', '{"x":1}');
end;

procedure TForm1.WAMPEvent(Connection: TsgcWSConnection;
  TopicURI, Event: string);
begin
  Memo1.Lines.Add(TopicURI + ': ' + Event);
end;

O que tem por dentro

3 published properties, 7 methods, 13 events — pulled from the component reference.

Connection

Published properties: Client, Broker.

Messaging

Events: OnMessage, OnBinary, OnFragmented.

Lifecycle

Events: OnConnect, OnDisconnect, OnWelcome.

Advanced

Methods: WriteData.

Diagnostics

Published properties: Version.

PubSub

Methods: Prefix, Subscribe, UnSubscribe.

Especificações & referências

Authoritative sources for the protocols this component implements.

Documentação & Demos

Acesse a referência do componente, pegue o projeto demo pronto para executar e baixe a versão de avaliação.

Ajuda online — Protocol_WAMP Referência completa de propriedades, métodos e eventos deste componente.
Projeto demo — Demos\Protocols\WAMP Exemplo pronto para executar. Acompanha o pacote sgcWebSockets — baixe a versão de avaliação abaixo.
Documento técnico (PDF) Features, quick start, code samples for Delphi, C++ Builder and .NET and primary-source references — this component only.
Manual do usuário (PDF) Manual completo cobrindo todos os componentes da biblioteca.

Ready to Get Started with WAMP?

Download the free trial and build real-time applications with unified RPC and PubSub.