Skip to content

[API Proposal]: Add Ping.SendPingAsync overloads with CancellationToken #67260

Description

@deeprobin

Background and motivation

This was already approved in #14336, but reverted in #67253 because this requires some more work.

See #64860 (comment)

API Proposal

namespace System.Net.NetworkInformation {
    public class Ping {
        public Task<PingReply> SendPingAsync(IPAddress address, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null, CancellationToken cancellationToken = default);
        public Task<PingReply> SendPingAsync(string hostNameOrAddress, TimeSpan timeout, byte[]? buffer = null, PingOptions? options = null, CancellationToken cancellationToken = default);
    }
}

/cc @danmoseley
/cc @stephentoub

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedarea-System.Nethelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions