Skip to content

Commit

Permalink
Deal with closing the named pipe while a write is in progress (hung c…
Browse files Browse the repository at this point in the history
…lients)
  • Loading branch information
fredemmott committed Dec 30, 2022
1 parent a5ea3f5 commit 8f6d7a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OTDIPC/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public void SendMessage<T>(T message) where T : struct
{
OnFailedWrite();
}
catch (ObjectDisposedException) {
// If we think the client's hung, we can close the connection
// while a write is in progress; this is especially common
// for ping writes.
OnFailedWrite();
}
finally
{
Marshal.FreeCoTaskMem(ptr);
Expand Down

0 comments on commit 8f6d7a5

Please sign in to comment.