- Home /
Unity3D network disconnects on idle (VR Game)
I am making an application which is run on external hardware machines. It will be turned on in the morning and turned off in the night. There may be huge gaps of idle time in between if there are no customers. If the idle period is long, it disconnects. The following is my connection config. please help me out.
connectionConfig.MaxConnectionAttempt = byte.MaxValue;
connectionConfig.ConnectTimeout = 3000;
connectionConfig.MaxCombinedReliableMessageCount = 20;
connectionConfig.MaxCombinedReliableMessageSize = 200;
connectionConfig.DisconnectTimeout = 3000;
connectionConfig.NetworkDropThreshold = 50;
connectionConfig.PingTimeout = 500;
Do let me know if I should provide more information. The clients can disconnect and should be able to reconnect without stopping the whole network ( I figured that part). But I am not able to handle the case where the server disconnects on time out.
Answer by Bunny83 · Dec 16, 2017 at 02:19 AM
Well you may want to increase the "DisconnectTimeout" which may reduce the chance of missing any keep-alive packets. Also make sure your application actually runs in the background. Many forget about this. In any networking application this is crucial.
You can either tick "run in background" in the player settings or set Application.runInBackground to true in your script.
Run in background is set to true in player settings. I am wondering if I should send a bool "$$anonymous$$eep alive" that toggles every few seconds ..going between the clients and server to fake it so it never goes to idle? Could you please explain how the internal keep alive packets works? Does it send only when some sync var change or when packets are transferred?
Update : Left the computer on in the non-vr mode. The game didn't crash. I am going to leave it on tonight with VR mode and update anyone else who is having the same problem. I suspect it has something do with VR In Unity or S$$anonymous$$m VR itself.
Your answer
Follow this Question
Related Questions
Unity Local network always disconnects after ~1053 seconds 0 Answers
is LLAPI bandwidth limited? 0 Answers
Unity High Level Api Random Disconnect 0 Answers
[UNET] Why client always random disconnect? 1 Answer
Network disconnect player 1 Answer