internal async Task ConnectAsync() { try { await Task.WhenAll( RemoteToLocalConnection.ConnectAsync(CancellationToken), LocalToRemoteConnection.ConnectAsync(CancellationToken)); } catch (Exception ex) { Console.WriteLine(ex); Console.WriteLine(); Console.WriteLine(Logger.Log); throw; } }
public void Dispose() { if (_isDisposed) { return; } using (_combinedCancellationTokenSource) { _combinedCancellationTokenSource.Cancel(); LocalToRemoteConnection.Dispose(); RemoteToLocalConnection.Dispose(); _simulatedIpc.Dispose(); // Other IDisposable fields should be disposed by the connections. } _isDisposed = true; }