Configuring Licensing Clients

In this topic: Hide

 

The information below is taken from the ATS Licensing Server help documentation, as in some instances the Licensing Server may not be located on the same machine as the license Client:

You can configure various settings of the licensing client via its configuration file.

Configuration file location

The configuration is searched in these locations in the order shown. If the .config file is found and it contains the licensing client configuration section the client will stop searching. It will stop searching even if the configuration section is not complete (not all parameters are set). The locations are searched in the same order:

1.     The executable *.config file. For example, if your application is named MyApp.exe and there exists a file named MyApp.exe.config the client will search for the configuration section there.

2.     The class library *.config file. The client will look for ATSLicensingServer.Client.dll.config that is in the same folder as the currently loaded ATSLicensingServer.Client.dll. If the file doesn't exist or it doesn't contain the configuration section for the client default values will be loaded.

Configuration parameters

Parameters that can be set via configuration file.

1.     LicenseType - Possible values are Concurrent, NamedNetworked and Unknown (default). This will specify which type of license the client will request. If you set to Unknown the client will try to request Named and then Concurrent. If the request for Concurrent license fails too then the client will rise the shutdown event.

2.     ConnectRetryThreshold - How many times the client will try to connect to ATS Licensing server before giving up (Firing ServerUnavailable shutdown event) or trying backup server. The default is 3, min is 1, max is 5. Other values are changed to fit into allowed interval.

3.     ConnectTimeout - How long should the client wait in milliseconds before the initial connection to the server times out. This setting, along with the ConnectRetryThreshold, affects the time of failover to backup endpoint. The value cannot be less then 100 and more than 60000 (1 minute). Default is the standard network time out of 21000 (21 seconds).

4.     RenewRetryThreshold - How many times the client will retry to renew a license. If the renew fails, the client will try to request the license again. The default is 3, min is 1, max is 5. Other values are changed to fit into allowed interval.

5.     RenewalInterval - How long to wait between license heartbeats (renewals) in milliseconds. The default is 60000 (1 minute), the minimum is 2000 (2 seconds) and maximum is 1800000 (30 minutes). Other values are changed to fit into allowed interval. Please note that this setting should be the same as ConcurrentTimout and NamedTimout set on the licensing server. This should only be changed in special cases and you should know what you are doing.

6.     EndpointAddress - The URI for the Licensing server to which this client connects. Even though the old HTTP endpoints are still supported, always use NET.TCP endpoint for improved security and to able to use new functionality, like license releasing on application exit. The usual format for net.tcp is net.tcp://localhost:8001/ATSLicensingServer/

7.     BackupEndpointAddress - The URI for the Licensing server to which this client connects to if the primary licensing endpoint specified by EndpointAddress is unavailable.

8.     BackupEndpointAddress2 - The URI for the Licensing server to which this client connects to if the first backup licensing server endpoint specified by BackupEndpointAddress is unavailable.

Client config examples

This is the config with default values.

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <configSections>

    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

      <section name="ATSLicensingServer.Client.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

    </sectionGroup>

  </configSections>

  <startup>

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />

  </startup>

 

  <applicationSettings>

    <ATSLicensingServer.Client.Properties.Settings>

      <setting name="LicenseType" serializeAs="String">

        <value>Unknown</value>

      </setting>

      <setting name="ConnectRetryThreshold" serializeAs="String">

        <value>3</value>

      </setting>

      <setting name="ConnectTimeout" serializeAs="String">

        <value>21000</value>

      </setting>

      <setting name="RequestRetryThreshold" serializeAs="String">

        <value>3</value>

      </setting>

      <setting name="RenewRetryThreshold" serializeAs="String">

        <value>3</value>

      </setting>

      <setting name="RenewalInterval" serializeAs="String">

        <value>60000</value>

      </setting>

      <setting name="EndpointAddress" serializeAs="String">

        <value>net.tcp://localhost:8001/ATSLicensingServer/</value>

      </setting>

      <setting name="BackupEndpointAddress" serializeAs="String">

        <value ></value>

      </setting>

      <setting  name="BackupEndpointAddress2"  serializeAs="String">

        <value ></value>

      </setting>

    </ATSLicensingServer.Client.Properties.Settings>

  </applicationSettings>

</configuration>

You can safely remove all unused settings to make the configuration section simpler. Only the license server endpoint has to be set, while all other parameters will use default values. The default values will be used for any setting that is not set (either programmatically or via config file).

<?xml  version="1.0"  encoding="utf-8"?>

<configuration>

  <configSections>

    <sectionGroup  name="applicationSettings"  type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

      <section  name="ATSLicensingServer.Client.Properties.Settings"  type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  requirePermission="false" />

    </sectionGroup>

  </configSections>

  <startup>

    <supportedRuntime  version="v4.0"  sku=".NETFramework,Version=v4.0" />

  </startup>

 

  <applicationSettings>

    <ATSLicensingServer.Client.Properties.Settings>     

      <setting  name="EndpointAddress"  serializeAs="String">

        <value>net.tcp://localhost:8001/ATSLicensingServer/</value>

      </setting>    

    </ATSLicensingServer.Client.Properties.Settings>

  </applicationSettings>

</configuration>

If you configure the client programmatically you can remove the application settings section from the configuration file completely.

<?xml version="1.0" encoding="utf-8"?>

<configuration> 

  <startup>

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />

  </startup>

</configuration>