Skip to content

Commit 3137672

Browse files
committed
Add comments
1 parent 6053ce3 commit 3137672

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/RazorSdk/Tool/Client.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ public override async Task WaitForDisconnectAsync(CancellationToken cancellation
171171
try
172172
{
173173
ServerLogger.Log($"Before poking pipe {Identifier}.");
174+
// Stream.ReadExactlyAsync with a zero-length buffer will not update the state of the pipe.
175+
// We need to trigger a state update without actually reading the data.
174176
_ = await Stream.ReadAsync(Array.Empty<byte>(), 0, 0, cancellationToken);
175177
ServerLogger.Log($"After poking pipe {Identifier}.");
176178
}

src/RazorSdk/Tool/ConnectionHost.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public override async Task WaitForDisconnectAsync(CancellationToken cancellation
107107
try
108108
{
109109
ServerLogger.Log($"Before poking pipe {Identifier}.");
110+
// Stream.ReadExactlyAsync with a zero-length buffer will not update the state of the pipe.
111+
// We need to trigger a state update without actually reading the data.
110112
_ = await Stream.ReadAsync(Array.Empty<byte>(), 0, 0, cancellationToken);
111113
ServerLogger.Log($"After poking pipe {Identifier}.");
112114
}

0 commit comments

Comments
 (0)