Skip to content

Commit 9f8e60a

Browse files
author
Jacques Kang
committed
fix issue that cancellation request not work after WaitForConnectionAsync is called
1 parent d2bf39b commit 9f8e60a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JKang.IpcServiceFramework.Server/NamedPipe/NamedPipeIpcServiceEndpoint.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ private void StartServerThread(object obj)
6060
var token = (CancellationToken)obj;
6161
try
6262
{
63-
using (var server = new NamedPipeServerStream(PipeName, PipeDirection.InOut, _options.ThreadCount))
63+
using (var server = new NamedPipeServerStream(PipeName, PipeDirection.InOut, _options.ThreadCount,
64+
PipeTransmissionMode.Byte, PipeOptions.Asynchronous))
6465
{
6566
server.WaitForConnectionAsync(token).Wait();
6667
ProcessAsync(server, _logger, token).Wait();

0 commit comments

Comments
 (0)