Skip to content

Commit

Permalink
Merge pull request #28 from tpwalke2/master
Browse files Browse the repository at this point in the history
Provide extension point for overriding default list of time servers
  • Loading branch information
ayende committed Sep 22, 2017
2 parents e4ccd44 + 959b1b6 commit 8cffc8d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Rhino.Licensing/AbstractLicenseValidator.cs
Expand Up @@ -73,7 +73,7 @@ public bool DisableTimeServersCheck
{
get; set;
}

/// <summary>
/// Gets the expiration date of the license
/// </summary>
Expand Down Expand Up @@ -396,7 +396,7 @@ private void ValidateUsingNetworkTime()
if (!NetworkInterface.GetIsNetworkAvailable())
return;

var sntp = new SntpClient(TimeServers);
var sntp = new SntpClient(GetTimeServers());
sntp.BeginGetDate(time =>
{
if (time > ExpirationDate)
Expand All @@ -408,6 +408,15 @@ private void ValidateUsingNetworkTime()
});
}

/// <summary>
/// Extension point to return different time servers
/// </summary>
/// <returns></returns>
protected virtual string[] GetTimeServers()
{
return TimeServers;
}

/// <summary>
/// Removes existing license from the machine.
/// </summary>
Expand Down

0 comments on commit 8cffc8d

Please sign in to comment.