Esempio n. 1
0
 private static BrokerGUIDelegateWrapper createGUIWrapper(BrokerGUI gui) => new BrokerGUIDelegateWrapper()
 {
     updatePubs      = gui.updatePublishers,
     updateSubs      = gui.updateSubscribers,
     updatePubTopics = gui.updatePublisherTopics,
     updateSubTopics = gui.updateSubscriberTopics,
     delete          = gui.deleteSubscriberTopic
 };
Esempio n. 2
0
        private static BrokerGUIDelegateWrapper createGUIWrapper(BrokerGUI gui)
        {
            BrokerGUIDelegateWrapper wrapper = new BrokerGUIDelegateWrapper();

            wrapper.updatePubs      = gui.updatePublishers;
            wrapper.updateSubs      = gui.updateSubscribers;
            wrapper.updatePubTopics = gui.updatePublisherTopics;
            wrapper.updateSubTopics = gui.updateSubscriberTopics;
            wrapper.delete          = gui.deleteSubscriberTopic;
            return(wrapper);
        }
Esempio n. 3
0
        private static void StartBrokerForm(object ipAndPort)
        {
            BrokerController brokerController = new BrokerController();
            BrokerGUI        brokerGUI        = new BrokerGUI(brokerController, (string)ipAndPort);

            brokerController.RegisterGUI(createGUIWrapper(brokerGUI));

            var wssv = new WebSocketServer(8008);

            wssv.AddWebSocketService("/BrokerController", () => {
                var server = new WebServer(createControllerWrapper(brokerController));
                brokerController.RegisterBoundary(server.BroadcastMessage);
                return(server);
            });

            wssv.Start();
            Application.Run(brokerGUI);
        }