Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Investigate overriding NetworkStream.CopyToAsync #18490

@stephentoub

Description

@stephentoub

NetworkStream doesn't override CopyToAsync, instead inheriting the base implementation that calls ReadAsync/WriteAsync in a loop. Each ReadAsync operation in turn creates a task that wraps the internal Socket APM implementation of Receive. Since a CopyToAsync will typically involve many receives, we should investigate overriding it to use SocketAsyncEventArgs, in order to avoid a bunch of the per iteration costs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions