# HG changeset patch # User StephaneLenclud # Date 1434874692 -7200 # Node ID 45afadb954bafefad075aa08de0d66c4ffe860e6 # Parent 6f1da2b5c2ec20ba1133c23dab9ec7e7dad1ea0c Fixing clients management. diff -r 6f1da2b5c2ec -r 45afadb954ba Server/MainForm.cs --- a/Server/MainForm.cs Fri Jun 19 17:12:06 2015 +0200 +++ b/Server/MainForm.cs Sun Jun 21 10:18:12 2015 +0200 @@ -566,12 +566,18 @@ //Check when was the last time we switched to that client - double lastSwitchToClientSecondsAgo = (DateTime.Now - iClients[aSessionId].LastSwitchTime).TotalSeconds; - //TODO: put that hard coded delay in settings - if (!aForce && (lastSwitchToClientSecondsAgo < 10)) + if (iCurrentClientData != null) { - //Don't switch clients too often - return; + double lastSwitchToClientSecondsAgo = (DateTime.Now - iCurrentClientData.LastSwitchTime).TotalSeconds; + //TODO: put that hard coded value as a client property + //Clients should be able to define how often they can be interrupted + //Thus a background client can set this to zero allowing any other client to interrupt at any time + //We could also compute this delay by looking at the requests frequencies? + if (!aForce && (lastSwitchToClientSecondsAgo < 30)) //Make sure a client is on for at least 30 seconds + { + //Don't switch clients too often + return; + } } //Set current client ID.