public void CloseCom(bool auto) { try { if (com.IsOpen) { Logger.LogMessage("CloseCom", "Close {0} [{1}]", com.PortName.ToUpper(), auto ? "CORE" : "USER"); com.DiscardOutBuffer(); com.DiscardInBuffer(); com.Close(); } mBuffer = 0; TX.Stop(); RX.Stop(); lock (this) { ClearQueue(false); } SetStatus(MacStatus.Disconnected); } catch (Exception ex) { Logger.LogException("CloseCom", ex); } }
protected override void OnClose(CloseEventArgs e) { lock (rxBuf) { Console.WriteLine("Connection lost!"); RX.Stop(); rxBuf.Clear(); TX.Stop(); txBuf.Clear(); } }
public void CloseCom() { if (opened) { opened = false; RX.Stop(); TX.Stop(); lock (rxBuf) { rxBuf.Clear(); txBuf.Clear(); } EmuLog("Connection lost!"); Tools.Serializer.ObjToFile(conf, filename); } }
public void CloseCom() { if (com.IsOpen) { com.DiscardOutBuffer(); com.DiscardInBuffer(); com.Close(); } mBuffer = 0; TX.Stop(); RX.Stop(); lock (this) { ClearQueue(false); } mMachineStatus = MacStatus.Disconnected; }
public void CloseCom(bool auto) { try { if (com.IsOpen) { com.Close(auto); } mBuffer = 0; TX.Stop(); RX.Stop(); lock (this) { ClearQueue(false); } SetStatus(MacStatus.Disconnected); } catch (Exception ex) { Logger.LogException("CloseCom", ex); } }