Begins an asynchronous read operation that reads data from the stream and stores it in the specified array.
- buffer
- A byte array that receives the bytes read from the stream.
- offset
- The zero-based location in buffer at which to begin storing the data read from this stream.
- count
- The maximum number of bytes to read from the stream.
- asyncCallback
- An AsyncCallback delegate that references the method to invoke when the read operation is complete.
- asyncState
- A user-defined object that contains information about the read operation. This object is passed to the asyncCallback delegate when the operation completes.
An IAsyncResult object that indicates the status of the asynchronous operation.
If encryption and or signing are enabled, the read operation reads the data from the underlying stream, checks the integrity of the data, and/or decrypts it. The asynchronous read operation must be completed by calling the SslStream.EndRead(IAsyncResult) method. Typically, the method is invoked by the asyncCallback delegate.
This method does not block while the operation completes. To block until the operation completes, use the SslStream.Read(Byte[], int, int) method.
For detailed information about using the asynchronous programming model, see Asynchronous Programming Overview
The System.Net.Security.SslStream class does not support multiple simultaneous read operations.
You cannot call this method until you have successfully authenticated. To authenticate call one of the erload:System.Net.Security.SslStream.AuthenticateAsClient, or erload:System.Net.Security.SslStream.BeginAuthenticateAsClient, erload:System.Net.Security.SslStream.AuthenticateAsServer, erload:System.Net.Security.SslStream.BeginAuthenticateAsServer methods.