Scenario: process creates pipe with CreateNamedPipe() and connects to it with ConnectNamedPipe(), transfers some data, then exits (with no cleanup). Does the pipe persist? Does the other side of it, which is opened in a different process with CreateFile(), error out when the creating process exits?

More generally, what is the lifetime of named pipes? How should stale pipes be cleaned up?

有帮助吗?

解决方案

Pipes are kernel objects, they stay alive until all handles on them are closed.

You are likely to get ERROR_BROKEN_PIPE if the client doesn't say goodbye nicely and the other process keeps using it anyway.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top