Skip to content

Commit

Permalink
Merge pull request jacqueskang#48 from jacqueskang/bugfix-namedpipes-…
Browse files Browse the repository at this point in the history
…cancellation

fix issue that cancellation request not work after WaitForConnectionA…
  • Loading branch information
jacqueskang authored Dec 11, 2018
2 parents d2bf39b + 9f8e60a commit ce4cb52
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ private void StartServerThread(object obj)
var token = (CancellationToken)obj;
try
{
using (var server = new NamedPipeServerStream(PipeName, PipeDirection.InOut, _options.ThreadCount))
using (var server = new NamedPipeServerStream(PipeName, PipeDirection.InOut, _options.ThreadCount,
PipeTransmissionMode.Byte, PipeOptions.Asynchronous))
{
server.WaitForConnectionAsync(token).Wait();
ProcessAsync(server, _logger, token).Wait();
Expand Down

0 comments on commit ce4cb52

Please sign in to comment.