AnonymousPipeClientStream Constructor (PipeDirection, SafePipeHandle^)

 

Initializes a new instance of the AnonymousPipeClientStream class from the specified handle.

Namespace:   System.IO.Pipes
Assembly:  System.Core (in System.Core.dll)

public:
[SecurityCriticalAttribute]
AnonymousPipeClientStream(
	PipeDirection direction,
	SafePipeHandle^ safePipeHandle
)

Parameters

direction
Type: System.IO.Pipes::PipeDirection

One of the enumeration values that determines the direction of the pipe.

Anonymous pipes can only be in one direction, so direction cannot be set to InOut.

safePipeHandle
Type: Microsoft.Win32.SafeHandles::SafePipeHandle^

A safe handle for the pipe that this AnonymousPipeClientStream object will encapsulate.

Exception Condition
ArgumentException

safePipeHandle is not a valid handle.

ArgumentNullException

safePipeHandle is null.

NotSupportedException

direction is set to InOut.

IOException

An I/O error, such as a disk error, has occurred.

-or-

The stream has been closed.

A PipeDirection value of InOut is not supported because anonymous pipes are defined to be one-way.

The following example demonstrates a way to send a string from a parent process to a child process by using anonymous pipes. In this example, an AnonymousPipeClientStream object is created in a child process with a PipeDirection value of In.

No code example is currently available or this language may not be supported.

Demand

for full trust for the immediate caller. This member cannot be used by partially trusted code.

.NET Framework
Available since 3.5
Return to top
Show: