SEBWIN-535: Implemented configuration mapping for ping interval of server proxy.
This commit is contained in:
parent
0abbef749e
commit
5d5e15e522
5 changed files with 19 additions and 1 deletions
|
@ -26,6 +26,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
|
|||
case Keys.Server.PerformFallback:
|
||||
MapPerformFallback(settings, value);
|
||||
break;
|
||||
case Keys.Server.PingInterval:
|
||||
MapPingInterval(settings, value);
|
||||
break;
|
||||
case Keys.Server.RequestAttempts:
|
||||
MapRequestAttempts(settings, value);
|
||||
break;
|
||||
|
@ -88,6 +91,14 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
|
|||
}
|
||||
}
|
||||
|
||||
private void MapPingInterval(AppSettings settings, object value)
|
||||
{
|
||||
if (value is int interval)
|
||||
{
|
||||
settings.Server.PingInterval = interval;
|
||||
}
|
||||
}
|
||||
|
||||
private void MapRequestAttempts(AppSettings settings, object value)
|
||||
{
|
||||
if (value is int attempts)
|
||||
|
|
|
@ -254,6 +254,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
settings.Security.KioskMode = KioskMode.CreateNewDesktop;
|
||||
settings.Security.VirtualMachinePolicy = VirtualMachinePolicy.Deny;
|
||||
|
||||
settings.Server.PingInterval = 1000;
|
||||
settings.Server.RequestAttemptInterval = 2000;
|
||||
settings.Server.RequestAttempts = 5;
|
||||
settings.Server.RequestTimeout = 30000;
|
||||
|
|
|
@ -296,6 +296,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
internal const string FallbackPasswordHash = "sebServerFallbackPasswordHash";
|
||||
internal const string Institution = "institution";
|
||||
internal const string PerformFallback = "sebServerFallback";
|
||||
internal const string PingInterval = "pingInterval";
|
||||
internal const string RequestAttempts = "sebServerFallbackAttempts";
|
||||
internal const string RequestAttemptInterval = "sebServerFallbackAttemptInterval";
|
||||
internal const string RequestTimeout = "sebServerFallbackTimeout";
|
||||
|
|
|
@ -333,7 +333,7 @@ namespace SafeExamBrowser.Server
|
|||
|
||||
pingTimer.AutoReset = false;
|
||||
pingTimer.Elapsed += PingTimer_Elapsed;
|
||||
pingTimer.Interval = 1000;
|
||||
pingTimer.Interval = settings.PingInterval;
|
||||
pingTimer.Start();
|
||||
logger.Info("Started sending pings.");
|
||||
|
||||
|
|
|
@ -51,6 +51,11 @@ namespace SafeExamBrowser.Settings.Server
|
|||
/// </summary>
|
||||
public bool PerformFallback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The time interval in milliseconds to be used for ping requests.
|
||||
/// </summary>
|
||||
public int PingInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The number of attempts (e.g. when receiving an invalid server response) before performing a fallback or failing.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Reference in a new issue