News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Game unresponsive whilst attempting to contact the listserver

Started by Mariculous, August 21, 2020, 01:21:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mariculous

I am not exactly sure if this issue still exists in standard, but it once did. So if it was fixed in the past, please let me know and move the thread.

When the list server is queried, e.g. when opening the "Play Online" dialogue, the game will be unresponsive until it either gets a response from the listserver or the action times out.
Same goes for querying a server, though it's not that bad here, as it will time out much faster.

Optimally the dialogue would open empty without these informations available, run the query in the background and update the dialogue as soon as the information is available.

I am aware that this is some kind of "in a perfect world" situation and likely needs a lot of changes in the code, so the easy solution would be to set a lower timeout. The current value feels like ages of unresponsivenes and will report as "simutrans is unresponsive" in some operating systems.

Is there any specific reason for that long timeout or can this be changed?

TurfIt

IIRC the timeout value is left to the operating system.  Also IIRC having Simutrans implement its own timeout would need a lot of OS specific code (and testing/maintenance that goes along with that).
All the Simutrans networking code / main loop is single threaded, so no easy background queries either.

prissi

The timeout is 10s for most Unixes and 30-40s for Windows. This is can be changed by fiddling in the registry but not otherwise at program level in the socket/connect routines. (I found that the ARP layer may help, but this is beyond what my network knowledge can do.) So nice to have but difficult.

Ters

It should be possible to set the socket (temporarily) to non-blocking, and then use select with the desired timeout for waiting. There is still the question of how long to wait.

prissi

Ok, I found something here http://developerweb.net/viewtopic.php?id=3196. Geven the already long code, I am somehow reluctant to add this monster into it.

Attempts to use SO_SNDTIMEO do not work on windows.