Author Topic: Connections get dropped  (Read 1649 times)

Dechcaudron

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Connections get dropped
« on: July 19, 2014, 06:02:54 PM »
Hello GCC,

while running some testing of new features we are implementing, my colleague and I ran into the following issue: once the second of us connects to the game, both connections get dropped. This makes very little sense, and I will proceed to describe the issue with more detail:

A week ago, we implemented a feature in which local apps sent the server a request to create a voxel in space and, if the request passed the requirements, it was forwarded to all the players (including the one who sent the request) so Unity would instantiate that voxel. So far so good.

Today, we were testing character movement in space. One of us can connect to the server and move around, and the server keeps track of the player. But when the second of us connects, the last connection or even both get dropped, (err=Connection lost). I did a bit of research in Program.cs and apparently the sockets are being closed when the second player connects to the server. We go back to the previous version and everything works fine (the three of us can connect), but in this last version it simply drops the connections for no apparent reason.

Any idea why this could be happening? Thanks a lot beforehand,
Dechcaudron

Dechcaudron

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: Connections get dropped
« Reply #1 on: July 21, 2014, 07:57:32 AM »
Hi again,

a member of my team found the cause of this issue. Improper Serialization/Deserialization was the cause. I know the server side does throw a clear exception of when this happens, but this command was clearly aided from the server towards the local side, so there was no chance that we would have ever found out via the exception thrown. Apparently, when the local side fails to deserialize the data received from the server, it closes the socket with the server and prints Null as the cause of the disconnection.

This issue drove me a bit crazy, since I started thinking that maybe my router had been closing the connections due to a security measure. I suggest you note this as an issue and get it fixed as soon as possible to fix future problems.

Thanks a lot,
Dechcaudron

AMarinov

  • Global Moderator
  • Newbie
  • *****
  • Posts: 17
    • View Profile
Re: Connections get dropped
« Reply #2 on: July 22, 2014, 08:32:05 AM »
Hi Dechcaudron,

Yes, we are aware of this problem and it will be fixed in the next version.

Regards,
Atanas