Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top