TsgcWSPServer_sgcProprietà › Broker

Broker Property

TsgcWSPServer_Broker facoltativo che consente a diversi sottoprotocolli lato server di condividere un unico server WebSocket anziché avere ciascun sottoprotocollo il proprio server.

Sintassi

property Broker: TsgcWSProtocol_Broker_Server read FBroker write SetBroker;

Valore predefinito

Note

Assegnare un TsgcWSPServer_Broker quando il server deve ospitare più di un sottoprotocollo sullo stesso TsgcWebSocketServer (ad esempio sgc + Files, o MQTT + Presence). Il broker contiene il riferimento al Server; ogni componente server del sottoprotocollo si collega poi al broker tramite la propria proprietà Broker. Server e Broker si escludono a vicenda.

Esempio


oServer := TsgcWebSocketServer.Create(nil);
oBroker := TsgcWSPServer_Broker.Create(nil);
oBroker.Server := oServer;
oProto := TsgcWSPServer_sgc.Create(nil);
oProto.Broker := oBroker;
oServer.Active := True;

Torna alle Proprietà