High latency in local network

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
Idon
Posts: 6
Joined: 19 Aug 2011, 14:14
Location: Russia

High latency in local network

Post by Idon »

Hi,

I'm using custom sync method instead of built-in PING_PONG:

I send 10 ExtensionRequests from client to server.

Server side:

Code: Select all

	public void handleClientRequest(User player, ISFSObject params) {
		ISFSObject res = new SFSObject();
		long timestamp = new Date().getTime();
		res.putLong("tm", timestamp);
		
		MainExtension parentExt = (MainExtension) getParentExtension();
		parentExt.send(Cmd.SYNC_TIME, res, player);
	}
and then calculate avarage lag.

When I test it locally, i get average lag ~ 8 ms

But when i connect from other comuter in local network area, i get 350 ms latency, though average ping time (windows->cmd->ping) of server host computer is 2 ms.

What may be the problem? Am I doing something wrong?

Thanks in advance,
Ilya
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Maybe you are using wireless connections which tend to be slow especially if their signal is not strong enough.
Other reasons could be that you have a slow local network which generates lots of packet fragments. Sounds strange to me but everything is possible.
Without any other info it's quite difficult to guess :)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply