-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: Add Ping.SendPingAsync
overloads with CancellationToken
#67260
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBackground and motivationThis was already approved in #14336, but reverted in #67253 because this requires some more work. See #64860 (comment) API Proposalnamespace System.Net.NetworkInformation {
public class Ping {
public Task<PingReply> SendPingAsync(IPAddress address, TimeSpan timeout, byte[]? buffer, PingOptions? options, CancellationToken cancellationToken);
public Task<PingReply> SendPingAsync(string hostNameOrAddress, TimeSpan timeout, byte[]? buffer, PingOptions? options, CancellationToken cancellationToken);
}
} API UsageAlternative DesignsNo response RisksNo response
|
Updated to match what was approved. |
@danmoseley Thanks. I removed the trailing |
How about returning namespace System.Net.NetworkInformation;
public class Ping {
public ValueTask<PingReply> SendPingAsync(IPAddress address, TimeSpan timeout, Memoty<byte> buffer = default, PingOptions? options = null, CancellationToken cancellationToken = default);
public ValueTask<PingReply> SendPingAsync(string hostNameOrAddress, TimeSpan timeout, Memory<byte> buffer = default, PingOptions? options = null, CancellationToken cancellationToken = default);
} |
Ping will almost always wait, so I think |
IMO, this proposal can be combined with #34856 |
I have some interest in working on this. One thought: could |
@danmoseley can you assign this issue to him?
@rhuijben Any thoughts? If we want to change the API shape, this API must be re-reviewed. |
…work). Provides "true" cancellation for async ping methods using either a token or the existing SendAsyncCancel() API. Fix dotnet#67260
Background and motivation
This was already approved in #14336, but reverted in #67253 because this requires some more work.
See #64860 (comment)
API Proposal
/cc @danmoseley
/cc @stephentoub
The text was updated successfully, but these errors were encountered: