Follow-up Comment #9, bug #24042 (project wesnoth):

I've done a bit more research into this bug and found that by setting the
"ping timeout" value in the preferences the client can detect if it is no
longer connected after the specified time. However, the other players who are
still connected to the original game will not detect that this player has
disconnected.

In the source code file network_worker.cpp there is code to deal with
disconnects in "receive_with_timeout" functions, etc. This code runs if the
original client that disconnects connection re-establishes even if they have
quit the game.

Hence, you might think that in the "receive_bytes" function SDLNet_TCP_Recv
might be a blocking call, waiting like a zombie to get information on a
separate thread. This doesn't appear to be the case, because I have refactored
my local version to do a SDLNet_CheckSockets and SDLNet_SocketReady and there
is no problem here with blocking that I can see as this code is not run when
there is a disconnect and only when the connection is re-established does it
run again.

This is highly frustrating to debug, but perhaps it could be solved by firstly
making the clients use the ping test "timeout" to the server as in the current
code for the client side. Then a test to each client from the server might be
needed as well to disconnect forcefully any client that isn't responding any
more.

When a client disconnects, perhaps they should be given an option to reconnect
with the same username and have the server do a check for any open connections
to that username, and then a second check  after a period of time to make sure
they are disconnected. Once this has been confirmed, then disconnect all
sockets with the old connection and allow login with the same handle.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?24042>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to