private void VirtualMachine_Stopped(object sender, EventArgs e) { vmRunning = false; OnUpdateControls(); DebuggerWorker.CancelAsync(); try { SerialStream.Close(); } catch { } try { if (Gdb != null) { Gdb.Dispose(); } } finally { Gdb = null; } if (restartingVM) { return; } if (Bootstrap.Parameters.ContainsKey("start")) { Application.Exit(); } }
public void Close() { if (_stream != null) { _stream.TelegramReceived -= TelegramReceived; _stream.Close(); } }
public void Close() { if (!isOpen) { throw new InvalidOperationException("Serial Port - port already closed!"); } if (internalSerialStream != null) { internalSerialStream.Close(); internalSerialStream = null; } isOpen = false; }
private void SerialStream_Read(IAsyncResult asyncResult) { int count = SerialStream.EndRead(asyncResult); if (count != 1) { try { SerialStream.Close(); Gdb.Dispose(); } catch { } SerialStream = new NamedPipeServerStream("System", PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous); SerialStream.BeginWaitForConnection(SerialStream_WaitForConnection, null); return; } SerialStream_ReadByte(buffer[0]); SerialStream.BeginRead(buffer, 0, 1, SerialStream_Read, null); }
public override void Disconnect() { _device.Close(); }
public override void Close() { NativeStream.Close(); NativeStream = null; }
void CloseAll() { stream.Close(); stream = null; }