TsgcWSPClient_AMQPProperties › Broker

Broker Property

Optional TsgcWSPClient_Broker that lets several subprotocols share a single WebSocket connection instead of each subprotocol owning its own Client.

Syntax

property Broker: TsgcWSProtocol_Broker_Client read FBroker write SetBroker;

Default Value

nil

Remarks

Assign a TsgcWSPClient_Broker when you need more than one subprotocol (for example sgc + Files, or MQTT + Presence) over the same WebSocket connection. The broker holds the Client reference; every subprotocol component then attaches to the broker via its own Broker property. Client and Broker are mutually exclusive — set one or the other.

Example


oClient := TsgcWebSocketClient.Create(nil);
oBroker := TsgcWSPClient_Broker.Create(nil);
oBroker.Client := oClient;
oProto := TsgcWSPClient_MQTT.Create(nil);
oProto.Broker := oBroker;
oClient.Active := True;

Back to Properties