Skip to content

Commit 0acbe3e

Browse files
committed
enhance: use PipeOptions.FirstPipeInstance to create NamedPipeServerStream
Signed-off-by: leo <[email protected]>
1 parent 05982e6 commit 0acbe3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Models/IpcChannel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ public IpcChannel()
1919
{
2020
try
2121
{
22-
_server = new NamedPipeServerStream("SourceGitIPCChannel", PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly);
22+
_server = new NamedPipeServerStream(
23+
"SourceGitIPCChannel",
24+
PipeDirection.In,
25+
1,
26+
PipeTransmissionMode.Byte,
27+
PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly | PipeOptions.FirstPipeInstance);
2328
_cancellationTokenSource = new CancellationTokenSource();
2429
Task.Run(StartServer);
2530
}

0 commit comments

Comments
 (0)