문제

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