Add debug info

Former-commit-id: fd723e06a9
This commit is contained in:
Malte Rosenbjerg 2020-12-06 00:34:27 +01:00
parent 73494b9765
commit f3e55c9ae3

View file

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;
@ -30,6 +31,7 @@ public void Pre()
public void Post()
{
Debug.WriteLine($"Disposing NamedPipeServerStream on {GetType().Name}");
Pipe?.Dispose();
Pipe = null!;
}
@ -39,9 +41,11 @@ public async Task During(CancellationToken cancellationToken = default)
try
{
await ProcessDataAsync(cancellationToken);
Debug.WriteLine($"Disconnecting NamedPipeServerStream on {GetType().Name}");
}
catch (TaskCanceledException)
{
Debug.WriteLine($"ProcessDataAsync on {GetType().Name} cancelled");
}
Pipe.Disconnect();
}