Sub PingTimer_Tick
'Log("PingTimer_Tick: " & wsh.ws.Connected & ", " & lastServerPong & ", " & (lastServerPong + 30 * DateTime.TicksPerSecond < DateTime.Now))
If wsh.ws.Connected = False Then Return
If lastServerPong + 30 * DateTime.TicksPerSecond < DateTime.Now Then
'Log("Closing connection after 30 seconds of no response")
wsh.Close
Else
Dim m As Map
m.Initialize
wsh.SendEventToServer("Device_Ping", m)
End If
End Sub