SGC Protocol

A JSON-RPC 2.0 based custom protocol providing remote procedure calls, publish-subscribe messaging, transactional operations, QoS, and message acknowledgment.

TsgcWSPClient_sgc / TsgcWSPServer_sgc

The native eSeGeCe Pub/Sub + RPC subprotocol — channels, queue levels, session resumption, transactions. Wire-compatible Delphi / C++ Builder / .NET.

Classe do componente

TsgcWSPClient_sgc

Protocolo

sgcWebSockets native subprotocol (over WebSocket)

Plataformas

Windows, macOS, Linux, iOS, Android

Edição

Standard / Professional / Enterprise

Drop the component, set a few properties, go

Drop a server + client subprotocol pair on top of a TsgcWebSocketServer and TsgcWebSocketClient.

uses
  sgcWebSocket, sgcWebSocket_Server, sgcWebSocket_Protocol_sgc_Server,
  sgcWebSocket_Protocol_sgc_Client, sgcWebSocket_Types;

var
  WSServer: TsgcWebSocketServer;
  ServerProto: TsgcWSPServer_sgc;
  WSClient: TsgcWebSocketClient;
  ClientProto: TsgcWSPClient_sgc;
begin
  // --- server side -----
  WSServer := TsgcWebSocketServer.Create(nil);
  WSServer.Port := 80;
  ServerProto := TsgcWSPServer_sgc.Create(nil);
  ServerProto.Server := WSServer;
  WSServer.Active := True;

  // --- client side -----
  WSClient := TsgcWebSocketClient.Create(nil);
  WSClient.Host := '127.0.0.1';
  WSClient.Port := 80;
  ClientProto := TsgcWSPClient_sgc.Create(nil);
  ClientProto.Client := WSClient;
  WSClient.Active := True;

  // publish / subscribe through a named channel
  ClientProto.Subscribe('orders');
  ClientProto.Publish('{"id":42}', 'orders', '', queueLevel0);
  ClientProto.RPC('call-1', 'getQuote', 'AAPL');
end;

O que tem por dentro

5 published properties, 11 methods, 15 events — pulled from the component reference.

Connection

Published properties: Client, Broker, Guid.

Messaging

Published properties: QoS.

Lifecycle

Events: OnConnect, OnDisconnect, OnError.

Advanced

Methods: WriteData.

Diagnostics

Published properties: Version.

PubSub

Methods: Subscribe, UnSubscribe, UnSubscribeAll.

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.

Projeto demo — Demos\Protocols\sgc Exemplo pronto para executar. Acompanha o pacote sgcWebSockets — baixe a versão de avaliação abaixo.
Documento técnico (PDF) Recursos, início rápido, exemplos de código para Delphi & C++ Builder e referências de fontes primárias — somente deste componente.
Manual do usuário (PDF) Manual completo cobrindo todos os componentes da biblioteca.

Ready to Use the SGC Protocol?

Download the free trial and start building with JSON-RPC messaging.