Ping

Methods
1
Fields
None

Methods

MethodReturnsDescription
pingCached(HttpWorld)numberThe round trip to world that the host last measured, in milliseconds, or -1 while none has landed or when the last attempt failed. Never…

Method details

pingCached

pingCached: (HttpWorld) -> number

The round trip to world that the host last measured, in milliseconds, or -1 while none has landed or when the last attempt failed. Never blocks, so it can run on the game thread. A call starts a measurement in the background when the last is a second old or more and none is running, so poll it (a loop that polls every few seconds reads a result one period old). The host times a TCP connect to the world's game port, 43594, which is one round trip. world:ping(id) and world:requestPing(id) are the same service by world number.