Is there a function that will display latency?
Is there a function that will display latency?
Is there a function that will display latency?
Re: Is there a function that will display latency?
Yes,
you can measure the client latency via the LagMonitor, built in the API.
After a successful login (i.e. in the Login event handler) you can add this line:
This will ping the server on a timely basis and report the average latency.
You can then query the lagMonitor like this:
(where sfs is the client instance name)
We also have an article here with more details:
https://smartfoxserver.com/blog/the-imp ... ing-times/
Cheers
you can measure the client latency via the LagMonitor, built in the API.
After a successful login (i.e. in the Login event handler) you can add this line:
Code: Select all
[client enableLagMonitor:YES];
This will ping the server on a timely basis and report the average latency.
You can then query the lagMonitor like this:
Code: Select all
int avgLag = [[sfs lagMonitor] averagePingTime];
(where sfs is the client instance name)
We also have an article here with more details:
https://smartfoxserver.com/blog/the-imp ... ing-times/
Cheers
Return to “SFS2X iPhone / iPad / OSX API”
Who is online
Users browsing this forum: No registered users and 52 guests