PipeStream.EndWrite Method (IAsyncResult)

 

Ends a pending asynchronous write request.

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

[SecurityCriticalAttribute]
public override void EndWrite(
	IAsyncResult asyncResult
)

Parameters

asyncResult
Type: System.IAsyncResult

The reference to the pending asynchronous request.

Exception Condition
ArgumentNullException

asyncResult is null.

ArgumentException

asyncResult did not originate from a BeginWrite method on the current stream.

IOException

The stream is closed or an internal error has occurred.

EndWrite must be called once for every call to BeginWrite. This can be done either in the same code that called BeginWrite or in a callback that is passed to BeginWrite.

Use the CanWrite property to determine whether the current PipeStream object supports write operations.

If the pipe is closed or an invalid argument is passed to BeginWrite, the appropriate exceptions are raised immediately. Errors that occur during an asynchronous write request occur on the thread pool thread that is performing the request. The exceptions are raised when the code the calls EndWrite method.

.NET Framework
Available since 3.5
Return to top
Show: