Ping.SendPingAsync 메서드

정의

컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

오버로드

SendPingAsync(String, TimeSpan, Byte[], PingOptions, CancellationToken)

지정된 데이터 버퍼가 있는 ICMP(Internet Control Message Protocol) 에코 메시지를 지정된 컴퓨터에 보내고 해당 컴퓨터에서 해당 ICMP 에코 회신 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하면 작업에 대한 제한 시간 값, 송신 및 수신에 사용할 버퍼, 조각화 및 TL(Time-to-Live) 값, ICMP 에코 메시지 패킷에 대한 을 CancellationToken 지정할 수 있습니다.

SendPingAsync(IPAddress)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

SendPingAsync(String)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

SendPingAsync(IPAddress, Int32)

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendPingAsync(String, Int32)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

SendPingAsync(IPAddress, Int32, Byte[])

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하면 작업의 시간 초과 값과 송수신하는 데 사용할 수 있는 버퍼를 지정할 수 있습니다.

SendPingAsync(String, Int32, Byte[])

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하면 작업의 시간 초과 값과 송수신하는 데 사용할 수 있는 버퍼를 지정할 수 있습니다.

SendPingAsync(IPAddress, Int32, Byte[], PingOptions)

지정된 IPAddress를 사용하는 컴퓨터에 지정된 데이터 버퍼의 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고, 해당 컴퓨터로부터 이에 해당하는 ICMP Echo Reply 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 보내고 받는 데 사용할 버퍼를 지정하며 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

SendPingAsync(String, Int32, Byte[], PingOptions)

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 보내고 받는 데 사용할 버퍼를 지정하며 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

SendPingAsync(IPAddress, TimeSpan, Byte[], PingOptions, CancellationToken)

지정된 IPAddress를 사용하는 컴퓨터에 지정된 데이터 버퍼의 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고, 해당 컴퓨터로부터 이에 해당하는 ICMP Echo Reply 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하면 작업에 대한 제한 시간 값, 송신 및 수신에 사용할 버퍼, 조각화 및 TL(Time-to-Live) 값, ICMP 에코 메시지 패킷에 대한 을 CancellationToken 지정할 수 있습니다.

설명

메서드에서 반환된 IP 주소는 SendPingAsync 악의적인 원격 컴퓨터에서 발생할 수 있습니다. 이를 사용하여 원격 컴퓨터에 연결하지 마세요. DNS를 사용하여 연결할 컴퓨터의 IP 주소를 확인합니다.

SendPingAsync(String, TimeSpan, Byte[], PingOptions, CancellationToken)

Source:
Ping.cs
Source:
Ping.cs

지정된 데이터 버퍼가 있는 ICMP(Internet Control Message Protocol) 에코 메시지를 지정된 컴퓨터에 보내고 해당 컴퓨터에서 해당 ICMP 에코 회신 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하면 작업에 대한 제한 시간 값, 송신 및 수신에 사용할 버퍼, 조각화 및 TL(Time-to-Live) 값, ICMP 에코 메시지 패킷에 대한 을 CancellationToken 지정할 수 있습니다.

public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (string hostNameOrAddress, TimeSpan timeout, byte[]? buffer = default, System.Net.NetworkInformation.PingOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
member this.SendPingAsync : string * TimeSpan * byte[] * System.Net.NetworkInformation.PingOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (hostNameOrAddress As String, timeout As TimeSpan, Optional buffer As Byte() = Nothing, Optional options As PingOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PingReply)

매개 변수

hostNameOrAddress
String

ICMP echo 메시지의 대상 컴퓨터입니다. 이 매개 변수에 지정된 값은 호스트 이름 또는 IP 주소의 문자열 표현일 수 있습니다.

timeout
TimeSpan

ICMP 에코 응답 메시지를 기다리는 시간(에코 메시지를 보낸 후)입니다.

buffer
Byte[]

ICMP Echo 메시지와 함께 보내지고 ICMP Echo Reply 메시지에 담겨 반환되는 데이터가 포함된 Byte 배열입니다. 배열은 65,500바이트를 초과할 수 없습니다.

options
PingOptions

ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어하는 데 사용되는 PingOptions 개체입니다.

cancellationToken
CancellationToken

취소 요청을 모니터링할 토큰입니다. 기본값은 None입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

적용 대상

SendPingAsync(IPAddress)

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::Net::IPAddress ^ address);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (System.Net.IPAddress address);
member this.SendPingAsync : System.Net.IPAddress -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (address As IPAddress) As Task(Of PingReply)

매개 변수

address
IPAddress

ICMP Echo 메시지의 대상 컴퓨터를 식별하는 IP 주소입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

address이(가) null인 경우

SendPingAsync를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

address이 유효한 IP 주소가 아닌 경우

이 개체가 삭제되었습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(String)

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::String ^ hostNameOrAddress);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (string hostNameOrAddress);
member this.SendPingAsync : string -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (hostNameOrAddress As String) As Task(Of PingReply)

매개 변수

hostNameOrAddress
String

ICMP echo 메시지의 대상 컴퓨터입니다. 이 매개 변수에 지정된 값은 호스트 이름 또는 IP 주소의 문자열 표현일 수 있습니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

hostNameOrAddressnull이거나 빈 문자열("")인 경우

SendAsync(String, Object) 메서드를 호출 중인 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

hostNameOrAddress의 유효한 IP 주소를 확인할 수 없는 경우

이 개체가 삭제되었습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(IPAddress, Int32)

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::Net::IPAddress ^ address, int timeout);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (System.Net.IPAddress address, int timeout);
member this.SendPingAsync : System.Net.IPAddress * int -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (address As IPAddress, timeout As Integer) As Task(Of PingReply)

매개 변수

address
IPAddress

ICMP Echo 메시지의 대상 컴퓨터를 식별하는 IP 주소입니다.

timeout
Int32

ICMP Echo 메시지를 보낸 후 ICMP Echo Reply 메시지를 기다리는 최대 시간(밀리초)입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

address이(가) null인 경우

SendAsync 메서드를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

address이 유효한 IP 주소가 아닌 경우

이 개체가 삭제되었습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(String, Int32)

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 통해 작업의 시간 제한 값을 지정할 수 있습니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::String ^ hostNameOrAddress, int timeout);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (string hostNameOrAddress, int timeout);
member this.SendPingAsync : string * int -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (hostNameOrAddress As String, timeout As Integer) As Task(Of PingReply)

매개 변수

hostNameOrAddress
String

ICMP echo 메시지의 대상 컴퓨터입니다. 이 매개 변수에 지정된 값은 호스트 이름 또는 IP 주소의 문자열 표현일 수 있습니다.

timeout
Int32

ICMP Echo 메시지를 보낸 후 ICMP Echo Reply 메시지를 기다리는 최대 시간(밀리초)입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

addressnull입니다.

timeout가 0보다 작은 경우

SendAsync 메서드를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

address이 유효한 IP 주소가 아닌 경우

이 개체가 삭제되었습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(IPAddress, Int32, Byte[])

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 IPAddress를 사용하는 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하면 작업의 시간 초과 값과 송수신하는 데 사용할 수 있는 버퍼를 지정할 수 있습니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::Net::IPAddress ^ address, int timeout, cli::array <System::Byte> ^ buffer);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (System.Net.IPAddress address, int timeout, byte[] buffer);
member this.SendPingAsync : System.Net.IPAddress * int * byte[] -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (address As IPAddress, timeout As Integer, buffer As Byte()) As Task(Of PingReply)

매개 변수

address
IPAddress

ICMP Echo 메시지의 대상 컴퓨터를 식별하는 IP 주소입니다.

timeout
Int32

ICMP Echo 메시지를 보낸 후 ICMP Echo Reply 메시지를 기다리는 최대 시간(밀리초)입니다.

buffer
Byte[]

ICMP Echo 메시지와 함께 보내지고 ICMP Echo Reply 메시지에 담겨 반환되는 데이터가 포함된 Byte 배열입니다. 배열은 65,500바이트를 초과할 수 없습니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

address 또는 buffernull인 경우

timeout가 0보다 작은 경우

SendPingAsync를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

address이 유효한 IP 주소가 아닌 경우

이 개체가 삭제되었습니다.

buffer의 크기가 65,500바이트를 초과하는 경우

Linux에서만 .NET 7 이상 버전: 프로세스가 권한이 없으며 buffer 비어 있지 않습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(String, Int32, Byte[])

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하면 작업의 시간 초과 값과 송수신하는 데 사용할 수 있는 버퍼를 지정할 수 있습니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::String ^ hostNameOrAddress, int timeout, cli::array <System::Byte> ^ buffer);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (string hostNameOrAddress, int timeout, byte[] buffer);
member this.SendPingAsync : string * int * byte[] -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (hostNameOrAddress As String, timeout As Integer, buffer As Byte()) As Task(Of PingReply)

매개 변수

hostNameOrAddress
String

ICMP echo 메시지의 대상 컴퓨터입니다. 이 매개 변수에 지정된 값은 호스트 이름 또는 IP 주소의 문자열 표현일 수 있습니다.

timeout
Int32

ICMP Echo 메시지를 보낸 후 ICMP Echo Reply 메시지를 기다리는 최대 시간(밀리초)입니다.

buffer
Byte[]

ICMP Echo 메시지와 함께 보내지고 ICMP Echo Reply 메시지에 담겨 반환되는 데이터가 포함된 Byte 배열입니다. 배열은 65,500바이트를 초과할 수 없습니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

hostNameOrAddressnull이거나 빈 문자열("")인 경우

또는

buffernull입니다.

timeout가 0보다 작은 경우

SendAsync를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

hostNameOrAddress의 유효한 IP 주소를 확인할 수 없는 경우

이 개체가 삭제되었습니다.

buffer의 크기가 65500바이트를 초과하는 경우

Linux에서만 .NET 7 이상 버전: 프로세스가 권한이 없으며 buffer 비어 있지 않습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(IPAddress, Int32, Byte[], PingOptions)

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 IPAddress를 사용하는 컴퓨터에 지정된 데이터 버퍼의 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고, 해당 컴퓨터로부터 이에 해당하는 ICMP Echo Reply 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 보내고 받는 데 사용할 버퍼를 지정하며 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::Net::IPAddress ^ address, int timeout, cli::array <System::Byte> ^ buffer, System::Net::NetworkInformation::PingOptions ^ options);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (System.Net.IPAddress address, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions? options);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (System.Net.IPAddress address, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions options);
member this.SendPingAsync : System.Net.IPAddress * int * byte[] * System.Net.NetworkInformation.PingOptions -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (address As IPAddress, timeout As Integer, buffer As Byte(), options As PingOptions) As Task(Of PingReply)

매개 변수

address
IPAddress

ICMP Echo 메시지의 대상 컴퓨터를 식별하는 IP 주소입니다.

timeout
Int32

ICMP Echo 메시지를 보낸 후 ICMP Echo Reply 메시지를 기다리는 최대 시간(밀리초)입니다.

buffer
Byte[]

ICMP Echo 메시지와 함께 보내지고 ICMP Echo Reply 메시지에 담겨 반환되는 데이터가 포함된 Byte 배열입니다. 배열은 65,500바이트를 초과할 수 없습니다.

options
PingOptions

ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어하는 데 사용되는 PingOptions 개체입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

address 또는 buffernull인 경우

timeout가 0보다 작은 경우

SendPingAsync를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

address이 유효한 IP 주소가 아닌 경우

이 개체가 삭제되었습니다.

buffer의 크기가 65,500바이트를 초과하는 경우

Linux에서만 .NET 7 이상 버전: 프로세스가 권한이 없으며 buffer 비어 있지 않습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(String, Int32, Byte[], PingOptions)

Source:
Ping.cs
Source:
Ping.cs
Source:
Ping.cs

지정된 컴퓨터에 ICMP(Internet Control Message Protocol) Echo 메시지와 지정된 데이터 버퍼를 보내고 해당 컴퓨터로부터 이에 대응하는 ICMP Echo Reply 메시지를 받는 작업을 비동기 작업으로 보냅니다. 이 오버로드를 사용하여 작업의 제한 시간 값을 지정하고 보내고 받는 데 사용할 버퍼를 지정하며 ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어할 수 있습니다.

public:
 System::Threading::Tasks::Task<System::Net::NetworkInformation::PingReply ^> ^ SendPingAsync(System::String ^ hostNameOrAddress, int timeout, cli::array <System::Byte> ^ buffer, System::Net::NetworkInformation::PingOptions ^ options);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (string hostNameOrAddress, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions? options);
public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (string hostNameOrAddress, int timeout, byte[] buffer, System.Net.NetworkInformation.PingOptions options);
member this.SendPingAsync : string * int * byte[] * System.Net.NetworkInformation.PingOptions -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (hostNameOrAddress As String, timeout As Integer, buffer As Byte(), options As PingOptions) As Task(Of PingReply)

매개 변수

hostNameOrAddress
String

ICMP echo 메시지의 대상 컴퓨터입니다. 이 매개 변수에 지정된 값은 호스트 이름 또는 IP 주소의 문자열 표현일 수 있습니다.

timeout
Int32

ICMP Echo 메시지를 보낸 후 ICMP Echo Reply 메시지를 기다리는 최대 시간(밀리초)입니다.

buffer
Byte[]

ICMP Echo 메시지와 함께 보내지고 ICMP Echo Reply 메시지에 담겨 반환되는 데이터가 포함된 Byte 배열입니다. 배열은 65,500바이트를 초과할 수 없습니다.

options
PingOptions

ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어하는 데 사용되는 PingOptions 개체입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

hostNameOrAddressnull이거나 빈 문자열("")인 경우

또는

buffernull입니다.

timeout가 0보다 작은 경우

SendAsync를 호출하고 있는 경우

ICMP 메시지를 보내거나 받는 동안 예외가 throw된 경우. throw된 정확한 예외에 대해서는 내부 예외를 참조하십시오.

hostNameOrAddress의 유효한 IP 주소를 확인할 수 없는 경우

이 개체가 삭제되었습니다.

buffer의 크기가 65500바이트를 초과하는 경우

Linux에서만 .NET 7 이상 버전: 프로세스가 권한이 없으며 buffer 비어 있지 않습니다.

설명

이 작업은 차단되지 않습니다. 반환 Task<TResult>> 된 개체는 ICMP 패킷을 보내고 응답을 받은 후에 완료됩니다.

적용 대상

SendPingAsync(IPAddress, TimeSpan, Byte[], PingOptions, CancellationToken)

Source:
Ping.cs
Source:
Ping.cs

지정된 IPAddress를 사용하는 컴퓨터에 지정된 데이터 버퍼의 ICMP(Internet Control Message Protocol) Echo 메시지를 보내고, 해당 컴퓨터로부터 이에 해당하는 ICMP Echo Reply 메시지를 비동기 작업으로 받습니다. 이 오버로드를 사용하면 작업에 대한 제한 시간 값, 송신 및 수신에 사용할 버퍼, 조각화 및 TL(Time-to-Live) 값, ICMP 에코 메시지 패킷에 대한 을 CancellationToken 지정할 수 있습니다.

public System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply> SendPingAsync (System.Net.IPAddress address, TimeSpan timeout, byte[]? buffer = default, System.Net.NetworkInformation.PingOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
member this.SendPingAsync : System.Net.IPAddress * TimeSpan * byte[] * System.Net.NetworkInformation.PingOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.NetworkInformation.PingReply>
Public Function SendPingAsync (address As IPAddress, timeout As TimeSpan, Optional buffer As Byte() = Nothing, Optional options As PingOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PingReply)

매개 변수

address
IPAddress

ICMP Echo 메시지의 대상 컴퓨터를 식별하는 IP 주소입니다.

timeout
TimeSpan

ICMP 에코 응답 메시지를 기다리는 시간(에코 메시지를 보낸 후)입니다.

buffer
Byte[]

ICMP Echo 메시지와 함께 보내지고 ICMP Echo Reply 메시지에 담겨 반환되는 데이터가 포함된 Byte 배열입니다. 배열은 65,500바이트를 초과할 수 없습니다.

options
PingOptions

ICMP Echo 메시지 패킷의 조각화 및 Time-to-Live 값을 제어하는 데 사용되는 PingOptions 개체입니다.

cancellationToken
CancellationToken

취소 요청을 모니터링할 토큰입니다. 기본값은 None입니다.

반환

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.

예외

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

적용 대상