getServerTime and getRoundTripTime in main loop

coldev
coldev
edited November 2017 in Native
Using this functions :
+getServerTime ()
+getRoundTripTime()

1. in main loop , consume lots bandwitdh ? consume very much cpu?
(Or photon uses estadistical internal vars for Ping ?)

main loop
t = getServerTime ()
r = getRoundTripTime()
end



2. getServerTime () return always negative values , is normal ?


i try to fix values using 2 functions in main loop

fetchServerTimestamp ()
t= getServerTime ()

values are negatives too..

3. getRoundTripTime returns 240 - 300 is normal ? my region is US
my PC in Colombia


Thanks 4 u help

Comments

  • I select region sao paulo (brazil ) "sa" and my ping is the same 250 ~ 300
  • Kaiserludi
    Kaiserludi admin
    edited November 2017
    Hi @coldev .

    1.
    getServerTime() and getRoundTripTime() both don't consume any bandwidth at all and both are extremely cheap in terms of CPU usage.

    2.

    getServerTime () return always negative values , is normal ?

    Yes, that is completely normal, just like for example https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx can also return negative values.

    3.
    When you use RegionSelectionMode::SELECT, then the list of available regions and the list of the server IP addresses for a master server in each of those regions arrives in Listener::onAvailableRegions().
    You can just printf the master server addresses (the demo_loadBalancing implementation of the callback already does that) and then copy and paste the IP address of the us / sa region from the output.
    Please ping that address in an OS command line window (do not include the port).
    What ping results do you get for those IPs inthe command-line?
  • coldev
    coldev
    edited November 2017
    Thanks 4 reply...

    Region EU
    ping 159.8.35.122 (report country DE -> germany -> europe OK)
    Media = 237ms
    PhotonGame 250-300ms

    Region Us
    ping 50.22.246.4 (America OK)
    Media = 188ms
    PhotonGame 200-230ms

    Region Sa
    ping 169.57.253.28 (report country DE -> germany? not is sao paulo brazil ?)
    Media = 238ms
    PhotonGame 300-312ms

    My ping is normal ? My internet sucks? what is the normal ping in my region ?

    Thanks
  • ChristianB
    edited November 2017
    I would like to see your traceroute resultes for the IP addresses you posted before to check if there is no routing issue. Please send to developer@photonengine.com:

    Windows: tracert 159.8.35.122
    Max/Linux: traceroute 159.8.35.122

    Please also include the result for region "USW":
    tracert app-usw.exitgames.com