Ping.Send Method (IPAddress, Int32, Byte(), PingOptions)
Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified IPAddress and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP echo message packet.
Assembly: System (in System.dll)
'Declaration Public Function Send ( _ address As IPAddress, _ timeout As Integer, _ buffer As Byte(), _ options As PingOptions _ ) As PingReply
- Type: System.Net.IPAddress
An IPAddress that identifies the computer that is the destination for the ICMP echo message.
- Type: System.Int32
An Int32 value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message.
- Type: System.Byte()
A Byte array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes.
Return ValueType: System.Net.NetworkInformation.PingReply
A PingReply object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received. The method will return PacketTooBig if the packet exceeds the Maximum Transmission Unit (MTU).
The size of buffer exceeds 65500 bytes.
address is Nothing.
buffer is Nothing, or the buffer size is greater than 65500 bytes.
timeout is less than zero.
A call to SendAsync is in progress.
address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000.
An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown.
This object has been disposed.
When specifying very small numbers for timeout, the Ping reply can be received even if timeout milliseconds have elapsed.
If the DontFragment property is true and the total packet size exceeds the maximum packet size that can be transmitted by one of the routing nodes between the local and remote computers, the ICMP echo request fails. When this happens, the Status is set to PacketTooBig.
Use the Ttl property to specify the maximum number of times the ICMP echo message can be forwarded before reaching its destination. If the packet does not reach its destination after being forwarded the specified number of times, the packet is discarded and the ICMP echo request fails. When this happens, the Status is set to TtlExpired.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.