Forum Multiplayer Frequent disconnects

Discussion and help relating to the PlayerIO Multiplayer API.

Frequent disconnects

Postby Drutten » August 12th, 2010, 7:41 pm

I'm making a small game to try out Player.io. The problem is after some activity players get kicked out at random by UserLeft(). It seems pretty random who stays and who gets kicked but there might be a pattern where one player always manages to keep in the game while the rest keep dropping randomly, normally within 20sec, maybe based on activity.

This happens both when running the dll on the test server and from player.io and i even get kicked when alone in game debugging from flash. The only output i get in VS2010 when getting dropped is: The thread '<No Name>' (0xb5c) has exited with code 0 (0x0) . Anyone else had this problem or got any clue why it happens?
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Frequent disconnects

Postby Oliver » August 12th, 2010, 8:44 pm

Hey Drutten,

That sounds really, really weird, and of course, totally unacceptable...

Could you possibly zip up the project and send it to me (my name at player.io), along with any steps that might be required to reproduce, and i'll get it debugged ASAP!

I don't think the debug message from VS2010 is the cause, rather just a symptom.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Frequent disconnects

Postby Drutten » August 12th, 2010, 9:24 pm

Hi!

Thanks for the fast answer! I've sent you the files with some explainations. Let me know if the mail didn't arrive and i'll upload the files somewhere.
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Frequent disconnects

Postby Drutten » August 13th, 2010, 10:17 am

Since I only just began making the game i had set all the usernames to GuestUser not having any kind of login or username input. Just adding "GuestUser"+Math.random() lets me play way longer without kicks. Actually I haven't been kicked at all after some minor testing so maybe there's the problem. Do you know if having all players playing on the same username could cause disconnects?
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Frequent disconnects

Postby Benjaminsen » August 13th, 2010, 10:20 am

Are you using BigDB to store data on the Player Object? If so it might throw errors if you are trying to save to the same BigDB object to fast.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Frequent disconnects

Postby Drutten » August 13th, 2010, 10:23 am

Nope, no BigDB only the multiplayer API. And after some more testing with more than 1 user i still get disconnects so it seems the user name isn't the issue.
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Frequent disconnects

Postby Oliver » August 13th, 2010, 1:16 pm

Hey Drutten,

I've received the files and have personally tried to reproduce your error, but have failed completely. No matter what i do i can't get them to disconnect (using the local development server).

One thing we discussed internally is that the server has a feature where if it has sent more than X messages to a client without receiving an TCP-Packet Acknowledged, then the connection is considered dead and is disconnected. X is a large number however, and we've ever only seen it happen during our stress tests (sending tons and tons of data as fast as possible over a slow connection), so that shouldn't be it here -- unless of course you have an especially slow machine or something where it blocks packages once in a while (some weird firewall / internet security thing).

Our servers are in Denmark (Hejsa, Du er fra Sverige, og vi er Danske... Hvis du nogansinda ar i København får du komme forbi og sige hej), so it can't be the lag to the servers. Also, then it wouldn't happen with the local development server as you say it does.

I think we need to know more about your setup: What sorts of hardware are you running and which OS?

If possible it would be really nice if you could make a video of yourself reproducing the issue - maybe that could give us some insight.

We're anxious to get this issue resolved: If it's something in our code, we want to fix it for everybody -- if it's something in your setup, we want it fixed for you, so you'll have a good experience with Player.IO.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Frequent disconnects

Postby Drutten » August 13th, 2010, 2:14 pm

The hardware it's been tested on varies since I've tried it both at work, at home and with friends who also get disconnected. I'm running Win7 and I know some that have tested use Vista aswell. I've sent you a mail proposing I show you this through Teamviewer. Skype would work aswell if you fancy.

Thanks for all the help, I'm allready getting a good experience with just the support and all the possibilities player.IO sports, the disconnects merely feel like a bump in the road ;)
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Frequent disconnects

Postby Drutten » August 13th, 2010, 2:36 pm

I realized players only drop if they keep sending connection.send("shoot", "tank" or "chat". When just standing still there's no problem staying in game. Don't know if that helps.
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am

Re: Frequent disconnects

Postby Oliver » August 13th, 2010, 2:54 pm

I looked at that part of your code, and as far as i can tell, you're only sending in the "tank" messages once every 100ms, which is super acceptable, so i don't think it's congestion there.
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Frequent disconnects

Postby Oliver » August 13th, 2010, 6:16 pm

Hey,

So after some debugging we found the issue. It was Flash that garbage collected the connection inside the Flash player because there was no stored reference to it. This caused the connection to be disconnected.

You could work around this by keeping a reference to the connection somewhere.

We think this is something other people might run into, so we've just released an update where the api saves an internal reference to connections, such that they're never garbage collected.

In order to update you have to do... exactly nothing! Flash will automatically download the latest code when you run your game.

I hope this solves the issue. We are unable to reproduce it after we fixed this issue.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Frequent disconnects

Postby Drutten » August 13th, 2010, 7:52 pm

This is great news! Been testing for a good 50min now without any problems at all.
Thanks alot! Excellent support!
Drutten
 
Posts: 9
Joined: August 9th, 2010, 7:47 am


Return to Multiplayer