public Task Stop() { if (_stoppingSemaphor == null) { _stoppingSemaphor = new SemaphoreSlim(0, 1); Controller.Disconnect(); } return(_stoppingSemaphor.WaitAsync()); }
public void Disconnect() { controller.Disconnect(); }
// DOS (stop) private void button1_Click(object sender, EventArgs e) { controller.Disconnect(); label_PortStatus.ForeColor = System.Drawing.Color.Blue; label_PortStatus.Text = "PortStatus : disconnected (re-connect)"; }