Skip to content

Commit

Permalink
try to reorder the operations
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik committed Oct 15, 2021
1 parent 12359d9 commit 413ee9b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public async Task ReadAllBytes_NonSeekableFileStream_InWindows()

using (var cts = new CancellationTokenSource())
{
Task writingServerTask = WaitConnectionAndWritePipeStreamAsync(namedPipeWriterStream, contentBytes, cts.Token);
Task<byte[]> readTask = Task.Run(() => File.ReadAllBytes(pipePath), cts.Token);
Task writingServerTask = WaitConnectionAndWritePipeStreamAsync(namedPipeWriterStream, contentBytes, cts.Token);
cts.CancelAfter(TimeSpan.FromSeconds(3));

await writingServerTask;
Expand Down

0 comments on commit 413ee9b

Please sign in to comment.