Skip to content

refactor: harden the single-instance pipe server - #979

Merged
albertospelta merged 1 commit into
mainfrom
refactor/single-instance
Oct 19, 2026
Merged

albertospelta merged 1 commit into
mainfrom
refactor/single-instance

Conversation

@albertospelta

Copy link
Copy Markdown
Member

Port the single-instance changes: IInstanceActivationEvents becomes IInstanceEvents, the server reports failures through ErrorEventArgs, rejects empty payloads and bounds the read buffer, and the client reports a refused payload as a failed send.

Fix a stuck owner: when a client closed during the accept, the failed WaitForConnectionAsync left the stream waiting to connect, where NamedPipeServerStream.Disconnect throws without disconnecting. The instance stayed closing and every later accept failed, so the owner kept the pipe name but answered nobody. The server now disconnects the instance through DisconnectNamedPipe, generated by CsWin32.

Port the single-instance changes: IInstanceActivationEvents becomes
IInstanceEvents, the server reports failures through ErrorEventArgs,
rejects empty payloads and bounds the read buffer, and the client
reports a refused payload as a failed send.

Fix a stuck owner: when a client closed during the accept, the failed
WaitForConnectionAsync left the stream waiting to connect, where
NamedPipeServerStream.Disconnect throws without disconnecting. The
instance stayed closing and every later accept failed, so the owner
kept the pipe name but answered nobody. The server now disconnects
the instance through DisconnectNamedPipe, generated by CsWin32.
@albertospelta
albertospelta merged commit 4eefed2 into main Oct 19, 2026
1 check passed
@albertospelta
albertospelta deleted the refactor/single-instance branch October 19, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant