AnonymousPipeServerStream Constructor (PipeDirection, HandleInheritability, Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new instance of the AnonymousPipeServerStream class with the specified pipe direction, inheritability mode, and buffer size.

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

public AnonymousPipeServerStream(
	PipeDirection direction,
	HandleInheritability inheritability,
	int bufferSize


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.

Type: System.IO.HandleInheritability

One of the enumeration values that determines whether the underlying handle can be inherited by child processes. Must be set to either None or Inheritable.

Type: System.Int32

The size of the buffer. This value must be greater than or equal to 0.

Exception Condition

inheritability is not set to either None or Inheritable.


bufferSize is less than 0.


direction is set to InOut.

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

This constructor creates an AnonymousPipeServerStream object without pipe security.


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