Method WriteAsync
- Namespace
- DotNetBrowser.Net
- Assembly
- DotNetBrowser.dll
WriteAsync(byte[])
Appends a chunk of the response data asynchronously. This method may be called multiple times to append several chunks.
public Task WriteAsync(byte[] data)
Parameters
databyte[]The response data bytes.
Returns
Remarks
Prefer this method over Write(byte[]) when calling from an async context or a Task-based handler, as it does not block the calling thread while waiting for the data to be sent to the browser engine.
When all the chunks are written either the Complete() or Fail() method must be called to indicate that the request is completed or failed.
WriteAsync(byte[], int, int)
Appends a segment of the response data asynchronously. This method may be called multiple times to append several chunks.
public Task WriteAsync(byte[] data, int offset, int count)
Parameters
databyte[]The buffer containing the response data bytes.
offsetintThe zero-based byte offset in
data.countintThe number of bytes to write.
Returns
Remarks
Prefer this method over Write(byte[], int, int) when calling from an async context or a Task-based handler, as it does not block the calling thread while waiting for the data to be sent to the browser engine.
When all the chunks are written either the Complete() or Fail() method must be called to indicate that the request is completed or failed.