private void ButtonStartStopClick(object sender, EventArgs e) { if (!bIsRunning) { bIsRunning = true; try { MqttServerHelper.Start(); MqttClientHelper.Start(); TcpClientHelper.Start(); TcpServerHelper.Start(); UDPServerHelper.Start(); UDPClientHelper.Start(); } catch (Exception error) { Log("star error " + error.ToString()); return; } buttonStartStop.Text = @"Stop"; DgiotHelper.GetIps(); SaveAppConfig(); } else { ToStop(); } }
private void Resh_Config() { MqttClientHelper.Config(); MqttServerHelper.Config(); TcpClientHelper.Config(); TcpServerHelper.Config(); UDPClientHelper.Config(); UDPServerHelper.Config(); SerialPortHelper.Config(); PLCHelper.Config(config.AppSettings.Settings); OPCDAHelper.Config(); OPCUAHelper.Config(config.AppSettings.Settings); AccessHelper.Config(config.AppSettings.Settings); SqlServerHelper.Config(config.AppSettings.Settings); }
private void ToStop() { try { buttonStartStop.Text = @"Start"; bIsRunning = false; MqttClientHelper.Stop(); MqttServerHelper.Stop(); TcpClientHelper.Stop(); TcpServerHelper.Stop(); UDPClientHelper.Stop(); UDPServerHelper.Stop(); } catch (Exception e) { Log("stop server exception:" + e.Message); return; } }