Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​IO.​Pipes.​AnonymousPipeServerStream

Assembly: System.IO.Pipes

Inheritance: object → MarshalByRefObjectStreamPipeStream → AnonymousPipeServerStream

Implemented Interfaces

Exposes a stream around an anonymous pipe, which supports both synchronous and asynchronous read and write operations.

Properties

Gets the safe handle for the <see cref="T:System.IO.Pipes.AnonymousPipeClientStream" /> object that is currently connected to the <see cref="T:System.IO.Pipes.AnonymousPipeServerStream" /> object.
ReadMode
Sets the reading mode for the <see cref="T:System.IO.Pipes.AnonymousPipeServerStream" /> object. For anonymous pipes, transmission mode must be <see cref="F:System.IO.Pipes.PipeTransmissionMode.Byte" /> .
TransmissionMode
Gets the pipe transmission mode that is supported by the current pipe.
public bool
CanRead
Gets a value indicating whether the current stream supports read operations.
public bool
CanSeek
Gets a value indicating whether the current stream supports seek operations.
public bool
CanWrite
Gets a value indicating whether the current stream supports write operations.
public int
InBufferSize
Gets the size, in bytes, of the inbound buffer for a pipe.
public bool
IsAsync
Gets a value indicating whether a <see cref="T:System.IO.Pipes.PipeStream" /> object was opened asynchronously or synchronously.
public bool
IsConnected
Gets or sets a value indicating whether a <see cref="T:System.IO.Pipes.PipeStream" /> object is connected.
protected bool
IsHandleExposed
Gets a value indicating whether a handle to a <see cref="T:System.IO.Pipes.PipeStream" /> object is exposed.
public bool
IsMessageComplete
Gets a value indicating whether there is more data in the message returned from the most recent read operation.
public long
Length
Gets the length of a stream, in bytes.
public int
OutBufferSize
Gets the size, in bytes, of the outbound buffer for a pipe.
public long
Position
Gets or sets the current position of the current stream.
ReadMode
Gets or sets the reading mode for a <see cref="T:System.IO.Pipes.PipeStream" /> object.
Gets the safe handle for the local end of the pipe that the current <see cref="T:System.IO.Pipes.PipeStream" /> object encapsulates.
public bool
CanTimeout
public int
ReadTimeout
public int
WriteTimeout

Methods

protected void
Dispose​(bool disposing)
public void
DisposeLocalCopyOfClientHandle​()
Closes the local copy of the <see cref="T:System.IO.Pipes.AnonymousPipeClientStream" /> object's handle.
protected void
Finalize​()
Releases unmanaged resources and performs other cleanup operations before the <see cref="T:System.IO.Pipes.AnonymousPipeServerStream" /> instance is reclaimed by garbage collection.
public string
GetClientHandleAsString​()
Gets the connected <see cref="T:System.IO.Pipes.AnonymousPipeClientStream" /> object's handle as a string.
Returns A string that represents the connected <see cref="T:System.IO.Pipes.AnonymousPipeClientStream" /> object's handle.
public IAsyncResult
BeginRead​(byte[] buffer, int offset, int count, AsyncCallback? callback, object state)
Inherited from PipeStream
Begins an asynchronous read operation.
Returns An <see cref="T:System.IAsyncResult" /> object that references the asynchronous read.
buffer The buffer to read data into.
offset The byte offset in <paramref name="buffer" /> at which to begin reading.
count The maximum number of bytes to read.
callback The method to call when the asynchronous read operation is completed.
state A user-provided object that distinguishes this particular asynchronous read request from other requests.
public IAsyncResult
BeginWrite​(byte[] buffer, int offset, int count, AsyncCallback? callback, object state)
Inherited from PipeStream
Begins an asynchronous write operation.
Returns An <see cref="T:System.IAsyncResult" /> object that references the asynchronous write operation.
buffer The buffer that contains the data to write to the current stream.
offset The zero-based byte offset in <paramref name="buffer" /> at which to begin copying bytes to the current stream.
count The maximum number of bytes to write.
callback The method to call when the asynchronous write operation is completed.
state A user-provided object that distinguishes this particular asynchronous write request from other requests.
public int
EndRead​(IAsyncResult asyncResult)
Inherited from PipeStream
Ends a pending asynchronous read request.
Returns The number of bytes that were read. A return value of 0 indicates the end of the stream (the pipe has been closed).
asyncResult The reference to the pending asynchronous request.
public void
EndWrite​(IAsyncResult asyncResult)
Inherited from PipeStream
Ends a pending asynchronous write request.
asyncResult The reference to the pending asynchronous request.
public void
Flush​()
Inherited from PipeStream
Clears the buffer for the current stream and causes any buffered data to be written to the underlying device.
FlushAsync​(Threading.​CancellationToken cancellationToken)
Inherited from PipeStream
Asynchronously clears the buffer for the current stream and causes any buffered data to be written to the underlying device.
Returns A task that represent the asynchronous flush operation.
cancellationToken The token to monitor for cancellation requests.
protected void
InitializeHandle​(Microsoft.​Win32.​SafeHandles.​SafePipeHandle handle, bool isExposed, bool isAsync)
Inherited from PipeStream
Initializes a <see cref="T:System.IO.Pipes.PipeStream" /> object from the specified <see cref="T:Microsoft.Win32.SafeHandles.SafePipeHandle" /> object.
handle The <see cref="T:Microsoft.Win32.SafeHandles.SafePipeHandle" /> object of the pipe to initialize.
isExposed <see langword="true" /> to expose the handle; otherwise, <see langword="false" /> .
isAsync <see langword="true" /> to indicate that the handle was opened asynchronously; otherwise, <see langword="false" /> .
public int
Read​(byte[] buffer, int offset, int count)
Inherited from PipeStream
Reads a block of bytes from a stream and writes the data to a specified buffer starting at a specified position for a specified length.
Returns The total number of bytes that are read into <paramref name="buffer" /> . This might be less than the number of bytes requested if that number of bytes is not currently available, or 0 if the end of the stream is reached.
buffer When this method returns, contains the specified byte array with the values between <paramref name="offset" /> and ( <paramref name="offset" /> + <paramref name="count" /> - 1) replaced by the bytes read from the current source.
offset The byte offset in the <paramref name="buffer" /> array at which the bytes that are read will be placed.
count The maximum number of bytes to read.
public int
Read​(Span<​byte> buffer)
Inherited from PipeStream
Reads a sequence of bytes from the current stream, writes them to a byte array, and advances the position within the stream by the number of bytes read.
Returns The total number of bytes read into the <paramref name="buffer" /> . This can be less than the number of bytes allocated in <paramref name="buffer" /> if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
buffer A region of memory. When this method returns, the contents of this region are replaced by the bytes read from the current source.
ReadAsync​(byte[] buffer, int offset, int count, Threading.​CancellationToken cancellationToken)
Inherited from PipeStream
Asynchronously reads a sequence of bytes from the current stream to a byte array starting at a specified position for a specified number of bytes, advances the position within the stream by the number of bytes read, and monitors cancellation requests.
Returns A task that represents the asynchronous read operation. The value of its <see cref="P:System.Threading.Tasks.Task`1.Result" /> property contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
buffer The buffer to write the data into.
offset The byte offset in <paramref name="buffer" /> at which to begin writing data from the stream.
count The maximum number of bytes to read.
cancellationToken The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" /> .
ReadAsync​(Memory<​byte> buffer, Threading.​CancellationToken cancellationToken = null)
Inherited from PipeStream
Asynchronously reads a sequence of bytes from the current stream, writes them to a byte memory range, advances the position within the stream by the number of bytes read, and monitors cancellation requests.
Returns A task that represents the asynchronous read operation. The value of its <see cref="P:System.Threading.Tasks.ValueTask`1.Result" /> property contains the total number of bytes read into the buffer. The result value can be less than the number of bytes allocated in the buffer if that many bytes are not currently available, or it can be 0 (zero) if the end of the stream has been reached.
buffer The region of memory to write the data into.
cancellationToken The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" /> .
public int
ReadByte​()
Inherited from PipeStream
Reads a byte from a pipe.
Returns The byte, cast to <see cref="T:System.Int32" /> , or -1 indicates the end of the stream (the pipe has been closed).
public long
Seek​(long offset, SeekOrigin origin)
Inherited from PipeStream
Sets the current position of the current stream to the specified value.
Returns The new position in the stream.
offset The point, relative to <paramref name="origin" /> , to begin seeking from.
origin Specifies the beginning, the end, or the current position as a reference point for <paramref name="offset" /> , using a value of type <see cref="T:System.IO.SeekOrigin" /> .
public void
SetLength​(long value)
Inherited from PipeStream
Sets the length of the current stream to the specified value.
value The new length of the stream.
public void
WaitForPipeDrain​()
Inherited from PipeStream
Waits for the other end of the pipe to read all sent bytes.
public void
Write​(byte[] buffer, int offset, int count)
Inherited from PipeStream
Writes a block of bytes to the current stream using data from a buffer.
buffer The buffer that contains data to write to the pipe.
offset The zero-based byte offset in <paramref name="buffer" /> at which to begin copying bytes to the current stream.
count The maximum number of bytes to write to the current stream.
public void
Write​(ReadOnlySpan<​byte> buffer)
Inherited from PipeStream
Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
buffer A region of memory. This method copies the contents of this region to the current stream.
WriteAsync​(byte[] buffer, int offset, int count, Threading.​CancellationToken cancellationToken)
Inherited from PipeStream
Asynchronously writes a specified number of bytes from a byte array starting at a specified position, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
Returns A task that represents the asynchronous write operation.
buffer The buffer to write data from.
offset The zero-based byte offset in <paramref name="buffer" /> from which to begin copying bytes to the stream.
count The maximum number of bytes to write.
cancellationToken The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" /> .
WriteAsync​(ReadOnlyMemory<​byte> buffer, Threading.​CancellationToken cancellationToken = null)
Inherited from PipeStream
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
Returns A task that represents the asynchronous write operation.
buffer The region of memory to write data from.
cancellationToken The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" /> .
public void
WriteByte​(byte value)
Inherited from PipeStream
Writes a byte to the current stream.
value The byte to write to the stream.
public void
Close​()
Inherited from Stream
public void
CopyTo​(Stream destination)
Inherited from Stream
public void
CopyTo​(Stream destination, int bufferSize)
Inherited from Stream
CopyToAsync​(Stream destination)
Inherited from Stream
CopyToAsync​(Stream destination, int bufferSize)
Inherited from Stream
CopyToAsync​(Stream destination, int bufferSize, Threading.​CancellationToken cancellationToken)
Inherited from Stream
CopyToAsync​(Stream destination, Threading.​CancellationToken cancellationToken)
Inherited from Stream
CreateWaitHandle​()
Inherited from Stream
public void
Dispose​()
Inherited from Stream
DisposeAsync​()
Inherited from Stream
FlushAsync​()
Inherited from Stream
protected void
ObjectInvariant​()
Inherited from Stream
ReadAsync​(byte[] buffer, int offset, int count)
Inherited from Stream
public int
ReadAtLeast​(Span<​byte> buffer, int minimumBytes, bool throwOnEndOfStream = true)
Inherited from Stream
ReadAtLeastAsync​(Memory<​byte> buffer, int minimumBytes, bool throwOnEndOfStream = true, Threading.​CancellationToken cancellationToken = null)
Inherited from Stream
public void
ReadExactly​(byte[] buffer, int offset, int count)
Inherited from Stream
public void
ReadExactly​(Span<​byte> buffer)
Inherited from Stream
ReadExactlyAsync​(byte[] buffer, int offset, int count, Threading.​CancellationToken cancellationToken = null)
Inherited from Stream
ReadExactlyAsync​(Memory<​byte> buffer, Threading.​CancellationToken cancellationToken = null)
Inherited from Stream
WriteAsync​(byte[] buffer, int offset, int count)
Inherited from Stream
public object
GetLifetimeService​()
Inherited from MarshalByRefObject
public object
InitializeLifetimeService​()
Inherited from MarshalByRefObject
protected MarshalByRefObject
MemberwiseClone​(bool cloneIdentity)
Inherited from MarshalByRefObject
public bool
Equals​(object obj)
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object