private async Task<PingReply> SendPingAsyncCore(IPAddress address, byte[] buffer, int timeout, PingOptions options)
{
try
{
Task<PingReply> t = RawSocketPermissions.CanUseRawSockets(address.AddressFamily) ?
SendIcmpEchoRequestOverRawSocket(address, buffer, timeout, options) :
SendWithPingUtility(address, buffer, timeout, options);
PingReply reply = await t.ConfigureAwait(false);
if (_canceled)
{
throw new OperationCanceledException();
}
return reply;
}
finally
{
Finish();
}
}