Skip to content

Add Task-based async API for Socket.SendFile #42591

@geoffkizer

Description

@geoffkizer

Background and Motivation

We have an APM version of this and a SocketAsyncEventArgs version, but no Task-based version.

Current APM:

    public IAsyncResult BeginSendFile(string fileName, AsyncCallback? callback, object? state);
    public IAsyncResult BeginSendFile(string? fileName, byte[]? preBuffer, byte[]? postBuffer, TransmitFileOptions flags, AsyncCallback? callback, object? state); 

Proposed API

    public ValueTask SendFileAsync(string fileName);
    public ValueTask SendFileAsync(string? fileName, byte[]? preBuffer, byte[]? postBuffer, TransmitFileOptions flags);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions