NamedPipeServerStream Constructor (String^, PipeDirection)
Initializes a new instance of the NamedPipeServerStream class with the specified pipe name and pipe direction.
Assembly: System.Core (in System.Core.dll)
Parameters
- pipeName
-
Type:
System::String^
The name of the pipe.
- direction
-
Type:
System.IO.Pipes::PipeDirection
One of the enumeration values that determines the direction of the pipe.
| Exception | Condition |
|---|---|
| ArgumentNullException | pipeName is null. |
| ArgumentException | pipeName is a zero-length string. |
| ArgumentOutOfRangeException | |
| NotSupportedException | pipeName contains a colon (":"). |
| PlatformNotSupportedException | The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. |
| IOException | The maximum number of server instances has been exceeded. |
This constructor creates a NamedPipeServerStream object that has the following characteristics:
A PipeTransmissionMode value of Byte.
A PipeOptions value of None.
Default input and output buffer sizes.
No pipe security.
A HandleInheritability value of None.
No specified additional PipeAccessRights.
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. The NamedPipeServerStream object has a PipeDirection value of Out, which then blocks until a NamedPipeClientStream object establishes a connection to the current NamedPipeServerStream object.
For full trust for the immediate caller. This member cannot be used by partially trusted code.
Available since 3.5