public void Stop() { if (_client.IsConnected) { _client.Disconnect(); } }
public void DisConnect() { if (mqtt.IsConnected) { mqtt.Disconnect(); } }
void Stop() { if (_client.IsConnected) { _client.Disconnect(); MessageBox.Show("Stopped!!"); } }
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"); } }
protected override void OnStop() { if (mqttClient.IsConnected) { mqttClient.Disconnect(); } #if DEBUG Environment.Exit(0); #else log.Info("Service Stop"); #endif }
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(); }
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; } }
private void CloseMqtt() { client.Disconnect(); bgw2.RunWorkerAsync(); }
private void FrmMqttMain_FormClosed(object sender, FormClosedEventArgs e) { _mqtt.Disconnect(); }