jdmonin / JSettlers2

Java Settlers project home, downloads, and GPLv3 source code. To download the latest version as a JAR, see https://github.com/jdmonin/JSettlers2/releases/latest .
http://nand.net/jsettlers/
GNU General Public License v3.0
160 stars 63 forks source link

keep alive for client #106

Open kotc opened 5 months ago

kotc commented 5 months ago

most likely its my network provider, but is there some keep alive for connection between client and server? often after finishing the game i close it, but leave the client window open. then after idling for some time (30+ minutes) connection seems broken. ie. when i try to create new game i get a spinner on the mouse pointer and nothing else happens. if there isnt any keep alive, could the client have such option to send some noop command to the server to keep the connection alive?

kotc commented 5 months ago

either customizable or ~30-60s interval

kotc commented 5 months ago

and the window i'm talking about is this:

catan-client

ie. after connecting to server, but before creating a game

kotc commented 5 months ago

i've made simple test and i think there is some timer, because it timed out after 60 minutes:

*** nick-8626 left the game game-5013 at 21:49:10 ... vg3 left (7,7) Mon Apr 22 22:49:10 CEST 2024: java.net.SocketTimeoutException: Read timed out

so: 1/ why was it disconnected exactly? was it server or client giving up? 2/ adding keep alive would definitely be a good idea 3/ bots dont time out

kotc commented 4 months ago

src/main/java/soc/server/genericServer/NetConnection.java:65 //Timeout for reading from client is 1 hour, in milliseconds. protected final static int TIMEOUT_VALUE = 60 60 1000;

lets see if my client stops being booted after 1h idle in menu

kotc commented 4 months ago

yup, didnt get disconnected, even without doing anything for ~3.5h