SDKs
...
Tutorials
Licensing Scenarios

Floating Features

9min

Similar to Floating Licenses, LicenseSpring supports Floating features.

In this guide you can find an overview of the floating features functionality: registering and releasing floating features and setting up the Floating Features Watchdog.

Check if a feature is floating

As with floating licenses, you can check if a feature is floating using properties for cloud, as well as offline floating features. To start, use the following code to check if a license feature is floating:

C#
C++
Python


Floating slots

Developers will want to know the maximum number of users that can simultaneously use a floating feature and the current number of users using the feature. That can be done with:

C#
C++
Python


Floating timeout

You can get information on the floating feature timeout (in minutes) and the point in time until which a registered feature is valid (time of registration + floating feature timeout). After that time, LicenseSpring server will automatically release the feature - if it's not registered again.

C#
C++
Python


Registering and releasing floating features

Similar to floating licenses, floating features have to be periodically registered on the server for them to take up a floating slot.

C#
C++
Python


Note that in the C++ SDK you need to pass the feature code instead of the feature object to License::registerFloatingFeature

Likewise, if you wish to release a feature before its timeout, you can do it like so:

C#
C++
Python


In .NET SDK, ILicenseFeature data is not refreshed after registering and releasing the feature. In order to get updated values like FloatingSlotsInUse and FloatingEndDateTime you have to call ILicense.Features() method again.

The same applies to the C++ SDK. You have to call license->features() again to get updated feature values.

Watchdog setup

Similar to a floating license watchdog, floating features have to initialize the watchdog in order to use its functionalities.

Once set up, you register your floating features just once and the watchdog will make sure they will not expire until you manually release them (don't forget to do that on application shut down, so you don't keep the slots occupied).

You initialize the watchdog like so:

C#
C++
Python


Setting up the watchdog will also start the thread. If you wish to stop automatically extending your floating features, you can stop the watchdog:

C#
C++
Python


And once stoped, it can be restarted again:

C#
C++