Example #1
0
 public void Stop()
 {
     if (_client.IsConnected)
     {
         _client.Disconnect();
     }
 }
Example #2
0
 public void DisConnect()
 {
     if (mqtt.IsConnected)
     {
         mqtt.Disconnect();
     }
 }
Example #3
0
 void Stop()
 {
     if (_client.IsConnected)
     {
         _client.Disconnect();
         MessageBox.Show("Stopped!!");
     }
 }
Example #4
0
 void Stop()
 {
     if (_client.IsConnected)
     {
         Console.WriteLine("Client disconnecting\n");
         _client.Disconnect();
         Console.WriteLine("Client disconnected\n");
     }
 }
 void Stop()
 {
     if (_client.IsConnected)
     {
         //Console.WriteLine("Client disconnecting\n");
         textBoxMqttStatus.Text = "Mqtt disconnected";
         _client.Disconnect();
         //Console.WriteLine("Client disconnected\n");
     }
 }
 void Stop(string msg = "bye")
 {
     if (_client.IsConnected)
     {
         SendMsg(msg);
         btnClose.Visible = false;
         _client.Disconnect();
         Console.WriteLine("Client disconnected\n");
     }
 }
Example #7
0
        protected override void OnStop()
        {
            if (mqttClient.IsConnected)
            {
                mqttClient.Disconnect();
            }

#if DEBUG
            Environment.Exit(0);
#else
            log.Info("Service Stop");
#endif
        }
Example #8
0
        public void Dispose()
        {
            //foreach (var kv in subscriptions)
            //{
            //    try
            //    {
            //        handle.Unsubscribe(new string[] { kv.Key });
            //    }
            //    catch (Exception e)
            //    {
            //        Log.Error("MqttAdaptor Dispose throw exp:{0} key:{1}", e, kv.Key);
            //    }
            //}

            handle.Disconnect();
        }
Example #9
0
 public void Disconnect()
 {
     try
     {
         movement = new Movement();
         MoveCar();
         if (client != null && client.IsConnected)
         {
             client.Disconnect();
         }
         CamWebView.LoadContent("");
     }
     catch (Exception ex)
     {
         Toaster(ex.Message, ToastPriority.Critical, ToastLength.Long);
     }
     finally
     {
         _clientConnected = false;
     }
 }
Example #10
0
 private void CloseMqtt()
 {
     client.Disconnect();
     bgw2.RunWorkerAsync();
 }
Example #11
0
 private void FrmMqttMain_FormClosed(object sender, FormClosedEventArgs e)
 {
     _mqtt.Disconnect();
 }