NamedPipeServerStream::WaitForConnection Method ()
Waits for a client to connect to this NamedPipeServerStream object.
Assembly: System.Core (in System.Core.dll)
| Exception | Condition |
|---|---|
| InvalidOperationException | A pipe connection has already been established. -or- The pipe handle has not been set. |
| ObjectDisposedException | The pipe is closed. |
| IOException | The pipe connection has been broken. |
Calling this method causes the NamedPipeServerStream object to block until a client connects.
The following example demonstrates a method to send a string from a parent process to a child process using named pipes. This example creates a NamedPipeServerStream object in a parent process. This object has a PipeDirection value of Out, which then blocks until a NamedPipeClientStream object establishes a connection to the NamedPipeServerStream object. This example is part of a larger example provided for the NamedPipeServerStream and NamedPipeClientStream classes.
Available since 3.5