public void StopClient() { if (!running) { return; } running = false; if (writeThread != null) { writeThread.Stop(); writeThread = null; } if (readThread != null) { readThread.Stop(); readThread = null; } if (inputCapture != null) { inputCapture.StopCapturing(); inputCapture = null; } }
public void StartClient() { if (IsRunning) { return; } lock (this) { running = true; } inputCapture = new InputCapture(this); readThread = new ClientReadThread(this); writeThread = new ClientWriteThread(); readThread.Start(); writeThread.Start(); inputCapture.StartCapturing(); }