SDKs
...
Tutorials
Advanced Usage

Floating Server Usage

11min

Distributing software applications designed for closed networks comes with numerous obstacles.

Challenges include implementing node locking on virtual machines and activating licenses meant for devices with strict security demands, often in the absence of internet connectivity.

LicenseSpring provides a solution through a Floating License Server. This server can be set up and customized at your customers' locations, ensuring functionality even when the client application runs on a machine without internet access.

LicenseSpring's offerings encompass both a floating server tailored for private networks and a cloud-based floating license solution. The client SDK functions quite similarly in both situations.

To learn more about the processes of registering, deregistering, managing timeouts, and borrowing licenses using a cloud-based floating license, we encourage you to refer to our Floating Cloud Tutorial.

Floating Client Identifier

The floating client or instance identifier can be accessed through a License object by using:

C++
C#
Swift


This floating client identifier is set during registration, within the register method shown below.

Floating Client

The FloatingClient class is used to perform requests to LicenseSpring's floating server. Within a FloatingClient object, developers are able to:

  • Register and unregister clients.
  • Borrow licenses.*
  • Retrieve server information.
  • Check whether the connection to the floating server is online.

*Only offered in C++ SDK

Registering a Client

Developers register clients with the following method:

C++
Swift


Note: id is the user or instance id used for license registration, it can be anything: email, hostname, handle, etc.

licenseID is an optional parameter where a specific license identifier can be specified. If no parameter is provided, the license gets the default configuration for the product.

If registration is successful, a shared pointer to the License object is returned. If unsuccessful, an exception is thrown.

Unregistering a Client

The unregister method uses the exact same parameters as register:

C++
C#
Swift


This Boolean result is set to true if the client was unregistered successfully.

License Borrowing

Only available in the C++ SDK, the following method allows developers to register and borrow licenses at once:

C++
Swift


Note: The id parameter is the user or instance identifier used for license registration. borrowEndDateTime is the borrow end date time in format "%Y-%m-%dT%H:%M:%SZ", for example "2022-05-28T15:30:00Z".

borrowLicense() can throw the same exceptions as on registration and License::borrow, see those methods for more details.

For more information about license borrowing, see our Floating Licensing Tutorial.

Floating Server and License Information

A helper method for checking the connection the floating server is provided within the FloatingClient object:

C++
C#
Swift


Note: isOnline() methods have an optional parameter, throwExceptions, that indicates whether the method should throw exceptions.

Using the FloatingClient object, developers are also able to access a FloatingServerInfo object with:

C++
C#


FloatingServerInfo consists of:

  • RegistrationExpiry - The floating server registration expiry in minutes.
  • Servers - The list of floating server IP addresses available in the network.

In the .NET SDK, it is also possible to get the license information for a configured product with:

C#


Note: There is an optional parameter for GetLicenseInfo(), where a specific license identifier can be specified. If no parameter is provided, the license gets the default configuration for the product.

See our Get License Endpoint documentation for more information.