Forum ‹ Multiplayer ‹ Players getting disconnected
8 posts
• Page 1 of 1
Players getting disconnected
Hi,
I'm using the Actionscript client and have been having trouble with players getting disconnected (call to the disconnecthandler) from the PlayerIO server under certain circumstances. This does not happen on the local development server.
Each time a client clicks on the game field a package is sent to the server, some handling is done and then a message is broadcast to all players. What happens is that if a player clicks very rapidly, some of the players in the room (usually all of them) will get disconnected. This happens earlier if more players are in the room (ie, it might take 30 sec of click spamming to happen if there are only 2 players, but only a couple of seconds if there are 6).
My first instinct was that it's taking too long to process all the events and you get a cpu timeout, but isn't that supposed to give me errors? The error log is empty. It should also show up on the development server (I've seen those messages on the dev server before).
So my main question to continue investigation is: What can cause a player to get disconnected?
As far as I could find out it's only cpu timeout, but I found no definitive answer. Is it possible that something is happening locally that causes the client to disconnect itself? Are there anti-spam measures on the server with regards to packet counts or bandwidth?
In case it's relevant: I'm using FB QuickConnect to connect to the server.
Any thoughts and suggestions would be appreciated.
I'm using the Actionscript client and have been having trouble with players getting disconnected (call to the disconnecthandler) from the PlayerIO server under certain circumstances. This does not happen on the local development server.
Each time a client clicks on the game field a package is sent to the server, some handling is done and then a message is broadcast to all players. What happens is that if a player clicks very rapidly, some of the players in the room (usually all of them) will get disconnected. This happens earlier if more players are in the room (ie, it might take 30 sec of click spamming to happen if there are only 2 players, but only a couple of seconds if there are 6).
My first instinct was that it's taking too long to process all the events and you get a cpu timeout, but isn't that supposed to give me errors? The error log is empty. It should also show up on the development server (I've seen those messages on the dev server before).
So my main question to continue investigation is: What can cause a player to get disconnected?
As far as I could find out it's only cpu timeout, but I found no definitive answer. Is it possible that something is happening locally that causes the client to disconnect itself? Are there anti-spam measures on the server with regards to packet counts or bandwidth?
In case it's relevant: I'm using FB QuickConnect to connect to the server.
Any thoughts and suggestions would be appreciated.
- boyz
- Paid Member
- Posts: 4
- Joined: March 28th, 2011, 2:45 pm
Re: Players getting disconnected
Sounds like you are trying to send excessive amount of data to the users. The multiplayer server has a limited send buffer per player, if a players send buffer is full the user will be disconnected.
In short, you are saturating the users bandwidth and they are thus getting disconnected.
/Chris
In short, you are saturating the users bandwidth and they are thus getting disconnected.
/Chris
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Players getting disconnected
Thanks, I'll see if I can't reduce the traffic I'm making (I'm not entirely happy with the implementation anyway).
Is there a documentation about the restrictions on resources?
*edit: Another question: What is the overhead of a Message? IE, how large is the gain from aggregating messages, is the size of the type string a significant amount of the whole message, etc.
Is there a documentation about the restrictions on resources?
*edit: Another question: What is the overhead of a Message? IE, how large is the gain from aggregating messages, is the size of the type string a significant amount of the whole message, etc.
- boyz
- Paid Member
- Posts: 4
- Joined: March 28th, 2011, 2:45 pm
Re: Players getting disconnected
Player.IO uses binary serialization of your messages, additionally we do a lot to minimize the amount of data send back and forward. The overhead is less than 2byte per value in your message.
/Chris
/Chris
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Players getting disconnected
Thanks again, pretty good service with the fast answers 
I'm still not clear on how much of a difference there is between sending two messages with one value each (say a float) and one message with two values. The question could also be rephrased as "how much does an empty message cost?" What I'm getting at is that if the gain is very low, increasing the code complexity to implement some kind of message concatenating might not be worth it and changing the design to discourage this behaviour (and guard against it player side) might be better.
---
Reading this over again I think I may have misunderstood you. Do you mean that if I send a message with no values and the type string "a" it will be something like 3 bytes in size? And if I then add a message that's n bytes it will be 3 + n + 2?
Sorry if I'm being annoying with these questions, it's mostly just curiosity
I'm still not clear on how much of a difference there is between sending two messages with one value each (say a float) and one message with two values. The question could also be rephrased as "how much does an empty message cost?" What I'm getting at is that if the gain is very low, increasing the code complexity to implement some kind of message concatenating might not be worth it and changing the design to discourage this behaviour (and guard against it player side) might be better.
---
Reading this over again I think I may have misunderstood you. Do you mean that if I send a message with no values and the type string "a" it will be something like 3 bytes in size? And if I then add a message that's n bytes it will be 3 + n + 2?
Sorry if I'm being annoying with these questions, it's mostly just curiosity
- boyz
- Paid Member
- Posts: 4
- Joined: March 28th, 2011, 2:45 pm
Re: Players getting disconnected
Each message is send instantly to decrease latency, this means that each individual message will be wrapped in it's won TCP/IP packet. IE for each individual message you send you have a full tcp/ip header + transport in overhead.
Or said in another way, if possible use fewer messages.
Or said in another way, if possible use fewer messages.
Have more questions? Join us at #player.io on the freenode irc network. Making something cool with Player.IO? I would love to talk! My Skype handle is q-rious
-

Benjaminsen - .IO
- Posts: 808
- Joined: January 12th, 2010, 11:54 am
- Location: Denmark
Re: Players getting disconnected
Thanks, I've got a pretty good idea about this now.
Getting the bandwidth overload suggestion from you prompted me to dive deeper into some code that I didn't write (and the person who did has left). Seems they did some prett stupid stuff that caused a cascade of messages to be sent when new commands arrive before acknowledgement (ie, you're clicking more than once in every ping interval).
Getting the bandwidth overload suggestion from you prompted me to dive deeper into some code that I didn't write (and the person who did has left). Seems they did some prett stupid stuff that caused a cascade of messages to be sent when new commands arrive before acknowledgement (ie, you're clicking more than once in every ping interval).
- boyz
- Paid Member
- Posts: 4
- Joined: March 28th, 2011, 2:45 pm
Re: Players getting disconnected
We are also having a problem where players are getting disconnected when they are the recipients of large messages (we have some large messages in a turn based game where it's ok for message transmission to take a while.)
Does this imply that there is a maximum message size that can be sent without causing a disconnect on the victim recipient? If so, what is that size? What is the max size of the send buffer you referred to above?
I've seen other posts on this forum that explicitly said there is no maximum message size. But from what you've said here, it sounds like there is (due to the send buffer).
Any help is appreciated!
Benjaminsen wrote:The multiplayer server has a limited send buffer per player, if a players send buffer is full the user will be disconnected.
/Chris
Does this imply that there is a maximum message size that can be sent without causing a disconnect on the victim recipient? If so, what is that size? What is the max size of the send buffer you referred to above?
I've seen other posts on this forum that explicitly said there is no maximum message size. But from what you've said here, it sounds like there is (due to the send buffer).
Any help is appreciated!
- Claytonious
- Paid Member
- Posts: 13
- Joined: April 18th, 2012, 12:09 am
8 posts
• Page 1 of 1