# HG changeset patch
# User StephaneLenclud
# Date 1453753590 -3600
# Node ID 729e91c7d5b295d2a62eff5982ad13b507c67ac3
# Parent 7b6aa551eb6ccb4b6058282906281ce1fa29f2d5
Publishing v0.8.4.0
Now taking priority into account before switching client.
diff -r 7b6aa551eb6c -r 729e91c7d5b2 Server/MainForm.cs
--- a/Server/MainForm.cs Sun Jan 24 19:25:51 2016 +0100
+++ b/Server/MainForm.cs Mon Jan 25 21:26:30 2016 +0100
@@ -637,16 +637,26 @@
return;
}
+ ClientData requestedClientData = iClients[aSessionId];
//Check when was the last time we switched to that client
if (iCurrentClientData != null)
{
+ //Do not switch client if priority of current client is higher
+ if (!aForce && requestedClientData.Priority < iCurrentClientData.Priority)
+ {
+ 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
+ if (!aForce &&
+ requestedClientData.Priority == iCurrentClientData.Priority && //Time sharing is only if clients have the same priority
+ (lastSwitchToClientSecondsAgo < 30)) //Make sure a client is on for at least 30 seconds
{
//Don't switch clients too often
return;
@@ -658,7 +668,7 @@
//Set the time we last switched to that client
iClients[aSessionId].LastSwitchTime = DateTime.Now;
//Fetch and set current client data.
- iCurrentClientData = iClients[aSessionId];
+ iCurrentClientData = requestedClientData;
//Apply layout and set data fields.
UpdateTableLayoutPanel(iCurrentClientData);
}
diff -r 7b6aa551eb6c -r 729e91c7d5b2 Server/SharpDisplayManager.csproj
--- a/Server/SharpDisplayManager.csproj Sun Jan 24 19:25:51 2016 +0100
+++ b/Server/SharpDisplayManager.csproj Mon Jan 25 21:26:30 2016 +0100
@@ -34,7 +34,7 @@
index.htm
false
0
- 0.8.1.0
+ 0.8.4.0
false
true
true