AnonymousPipeServerStream Constructor (PipeDirection, HandleInheritability, Int32, PipeSecurity)


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, buffer size, and pipe security.

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

public AnonymousPipeServerStream(
	PipeDirection direction,
	HandleInheritability inheritability,
	int bufferSize,
	PipeSecurity pipeSecurity


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.

Type: System.Int32

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

Type: System.IO.Pipes.PipeSecurity

An object that determines the access control and audit security for the pipe.

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.


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