Skip to content

Commit f09367a

Browse files
fix: Append UserName to the SourceGitIPCChannel NamedPipeServerStream to allow multiple users usage on the same server (#1244) (#1246)
1 parent 00e56ce commit f09367a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Models/IpcChannel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public IpcChannel()
2222
_singletoneLock = File.Open(Path.Combine(Native.OS.DataDir, "process.lock"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
2323
_isFirstInstance = true;
2424
_server = new NamedPipeServerStream(
25-
"SourceGitIPCChannel",
25+
"SourceGitIPCChannel" + Environment.UserName,
2626
PipeDirection.In,
2727
-1,
2828
PipeTransmissionMode.Byte,
@@ -40,7 +40,7 @@ public void SendToFirstInstance(string cmd)
4040
{
4141
try
4242
{
43-
using (var client = new NamedPipeClientStream(".", "SourceGitIPCChannel", PipeDirection.Out))
43+
using (var client = new NamedPipeClientStream(".", "SourceGitIPCChannel" + Environment.UserName, PipeDirection.Out, PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly))
4444
{
4545
client.Connect(1000);
4646
if (!client.IsConnected)

0 commit comments

Comments
 (0)