Select your preferred scripting language. All code snippets will be displayed in this language.
class in UnityEngine
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
ClosePing any given IP address (given in dot notation).
The ping operation is asynchronous and a ping object can be polled for status using Ping.isDone.
When a response is received it is in Ping.time.
Note: On Windows Store Apps a stream socket is used to mimic ping functionality, it will try to open connection to specified ip address with port 80. Also you need to enable InternetClient capability in Package.appxmanifest.
ip | The IP target of the ping. |
isDone | Has the ping function completed? |
time | This property contains the ping time result after isDone returns true. |
Ping | Perform a ping to the supplied target IP address. |