Table of Contents

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

data byte[]

The response data bytes.

Returns

Task

A Task that represents the asynchronous write operation.

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

data byte[]

The buffer containing the response data bytes.

offset int

The zero-based byte offset in data.

count int

The number of bytes to write.

Returns

Task

A Task that represents the asynchronous write operation.

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.