示例#1
0
            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;
                }
            }
示例#2
0
            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;
            }