Вопрос

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