コード例 #1
0
        static Initializer()
        {
            mqttBroker = new MqttCommunicatorBroker(Constants.DEFAULT_PORT);
            mqttClient = new MqttCommunicatorClient("127.0.0.1", Constants.DEFAULT_PORT);

            mqttClient.Subscribe(Topics.PING);
            mqttClient.Subscribe(Topics.Log);

            mqttClient.MessageReceived += MqttMessageHandler.HandleMessage;

            MqttMessageHandler.ClientConnected += Client_Connected;
            MqttMessageHandler.ReceivedLog     += (clientId, log) => LogsViewModel.Logs.Add(new KeyValuePair <string, LogEvent>(clientId, log));
        }
コード例 #2
0
        public HotReloadingClient(string address, int port)
        {
            mqttClient = new MqttCommunicatorClient(address, port);
            mqttClient.MessageReceived += MqttMessageHandler.HandleMessage;

            mqttClient.Subscribe(Topics.CODE_CHANGE);

            MqttMessageHandler.NewCodeChangeFound += MqttMessageHandler_NewCodeChangeFound;
        }