TsgcWSPServer_WAMP › Proprietà › Broker
TsgcWSPServer_Broker facoltativo che consente a diversi sottoprotocolli lato server di condividere un unico server WebSocket anziché avere ciascun sottoprotocollo il proprio server.
property Broker: TsgcWSProtocol_Broker_Server read FBroker write SetBroker;
nil
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.
oServer := TsgcWebSocketServer.Create(nil);
oBroker := TsgcWSPServer_Broker.Create(nil);
oBroker.Server := oServer;
oProto := TsgcWSPServer_sgc.Create(nil);
oProto.Broker := oBroker;
oServer.Active := True;