Page 2 of 2

Posted: 20 Jun 2008, 14:29
by Lapo
Yep, there seem to be pretty bad problems with persistent connections.
I can suggest a simple experiment if your server is Linux based.
Are you familiar with netcat?

You could use that to listen on a custom TCP port and establish a connection using any client technology.
I'd suggest to use Flash. Simply open an XMLSocket or Socket connection to that port and leave it connected, sending any ping data every once in a while.

Under decent network conditions you should be able to keep up the connection for hours (and days too)

The test would also be useful to report the issue to your bandwidth provider.

Btw, making netcat listen on a port is a simple as this:

Code: Select all

nc -l 5555
where can be any free TCP port number (>1024)

Posted: 20 Jun 2008, 15:55
by darnpunk
Hi Lapo,

Many thanks for the tip. I am using Windows Server 2003 and will try to find the equivalent of the method you mentioned for the experiment. If you have anything similar for Windows, I hope you can share it.

I will try this out and post back a report. Thanks again!

Regards,
darnpunk :)

Posted: 21 Jun 2008, 08:42
by Lapo
try searching netcat for windows.

Messaging every second

Posted: 07 Jul 2008, 08:29
by samyphp
Hi there,

Am also having the same problem. i done all the above and tested,but the user getting logged out automatically. If anybody knows, please help me..

Thanks
Palanisamy

Posted: 10 Sep 2008, 02:39
by demofish
i've got this issue ,too
users alway got disconnected,even the user is still doing something---not an idle user.

Posted: 11 Sep 2008, 13:33
by Lapo
The reasons why a user can get disconnected can be various:

1- sloppy client connection
2- lack of server side bandwidth
3- too many dropped messages for the client (which is a direct consequence of #1)
4- too many messages in too little time. If you're trying to send 50+ messages per second it's easy to get these problems. Since this is impossible, try to avoid bombarding the client and server with an unreal number of messages per second. (Average network lag suggests an average between 10-20 msg/sec)
5- idleness

Based on how frequently this happens you should check that you have enough bandwidth, your messaging frequency and the configuration of the client queues.

Posted: 16 Sep 2008, 07:37
by 2paul
On my Serverside I do something like this...

Code: Select all

for (j=0;j<=200;j++){
	_server.sendResponse(res, currentRoomId, null, player, "str");
}
200 messages at once...
I have normal DSL6000, and some other netconnections open and a VPS-Server in the net...

Its a little bit slow (but still Ok), but i doesnt get disconnecet...

Before I do it with 500 messages at once, works fine :-)

Posted: 16 Sep 2008, 08:12
by Lapo
:shock: :shock: :shock:
Why in the world would you do that?
That's the best way to obstruct the socket channel between server and client... unless it's a just a test I would totally avoid to use anything like that in production code.

Posted: 16 Sep 2008, 08:23
by 2paul
I have a big world for many players (when its ready) and when the game starts I have to send all the places of gold...thats 200...

But you are right, that dosent work, i just work on it, and have comment the trace line, i have in the code above ...

Now i get in my local-network an disconnect, because of too many droped messages.

The trace slows the messages, so there was no problem before...

Posted: 16 Sep 2008, 08:39
by Lapo
I have a big world for many players (when its ready) and when the game starts I have to send all the places of gold...thats 200...
Assemble all those into a single message and send that.
Never use for loops around a sendResponse call, it will hurt the server and clients

Posted: 16 Sep 2008, 08:50
by 2paul
Ok, ok, maybe I think to easy :-)

Thx for your tip ...

Its much more work :-(

Code: Select all

for (var a=0;a<user_count_akt;a++){
	player_ID = all_Players[a].getUserId();
	player[0] = all_Players[a];
		
	if (player_ID != uid){
	_server.sendResponse(res, currentRoomId, null, player, "str");
			
	}
}
So you think this is although no good for sending the positions...
In the sendResponse I have only one player ( player[0] ), not an array of users...so I call the sendResponse very often, is this a problem for the server ??
Or it dosent matter ??

Posted: 16 Sep 2008, 17:02
by Lapo
As I said NEVER put a sendResponse inside a for loop :shock: :D
Didn't you notice that you should pass a list of recipients as the fourth argument of sendResponse?

So build the message first, populate a list of recipients next and finally perform ONE call to the sendResponse() method.

Posted: 17 Sep 2008, 07:47
by 2paul
Thx again...I will change it...you make a VERY GOOD Job here in the Forum :-)

Posted: 31 Oct 2008, 14:41
by sutekin
Hi,

I have same problem on legacy ElectroServer v3-7-3. I think this problems source is similar on all Java Socket Servers.

By the way is there an automated tool for migration from ES3 or other servers to SFS ?