Ends a pending asynchronous read request.
Assembly: System.Core (in System.Core.dll)
- Type: System.IAsyncResult
The reference to the pending asynchronous request.
Return ValueType: System.Int32
The number of bytes that were read. A return value of 0 indicates the end of the stream (the pipe has been closed).
This method returns the number of bytes read into the byte array specified by the earlier call to BeginRead.
Pass the returned IAsyncResult object to the method to determine how many bytes were read and to release operating system resources used for reading. must be called once for every call to BeginRead. This can be done either in the same code that called BeginRead or in a callback that is passed to BeginRead.
If the pipe is closed or an invalid argument is passed to BeginRead, the appropriate exceptions are raised immediately. Errors that occur during an asynchronous read request occur on the thread pool thread that is performing the request. The exceptions are raised when the code calls the method.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.