سؤال

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