Website logo
⌘K
Getting Started
Introduction
Basic Concepts
Opening an Account
Creating & Configuring Products
Integrating SDK and Configuring License Fulfillment
Activate a Key-Based License
Vendor Platform
Issuing New Licenses
License Detail View
Order Detail View
Customer Detail View
Metadata
Analytics
Settings
Product Configuration
Product Features
Product Custom Fields
Product Versioning
License Policies
Product Bundles
License Entitlements
Consumption Period in License/Features
License Types
Activations & Device Transfers
Features
Floating Features
Custom Fields
License Start Date
License Note
Maintenance Period
Trial Licenses
Floating Licenses
License Activation Types
Portals
End-User Portal
Offline Portal
Air-Gapped Portal
License API
License API Authorization
License Activation/Deactivation
License Check
License Feature Check
Consumption
Floating
Trial Key
Product Details
Device Variables
Changing Password
Versions
Installation File
Customer License Users
SSO URL
Management API
Making API Requests
Management API Authorization
Customer
Product
Order
License
Device
Analytics
SDKs
Tutorials
.NET/C# SDK
.NET/C# Management SDK
C++ SDK
Java SDK
Python SDK
Go SDK
Delphi SDK
Swift/Objective-C SDK
Android SDK
Unity SDK
Errors and Response Codes
Floating Server
API Reference
Deployment
Configuration
Floating Server UI
Securing the Server
Whitelabeling
FAQ
Floating Server Changelog
Integrations
Subscription Integration
Salesforce
FastSpring
Stripe
Shopify
Common Scenarios
Single Sign On (SSO)
Glossary
General
SDK Glossary
Vendor Platform
Product Configuration Glossary
License Configuration
Postman Collections
Frequently Asked Questions
Integrations
SDK
Changelog
License API changelog
Platform changelog
Docs powered by Archbee
SDKs
...
Tutorials
Licensing Scenarios

Floating Features

8min

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#
foreach (ILicenseFeature licenseFeature in license.Features())
{
  if(licenseFeature.IsFloating || licenseFeature.IsOfflineFloating)
  {
    // DO SOMETHING WITH A FLOATING FEATURE
  }
}


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#
uint maxUsers = licenseFeature.FloatingSlotsCount;
uint currentUsers = licenseFeature.FloatingSlotsInUse;


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#
uint floatingTimeout = license.FloatingTimeout;
DateTime floatingEndDateTime = license.FloatingEndDateTime;
DateTime floatingEndDateTimeUtc = license.FloatingEndDateTimeUtc;


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#
ILicenseManager licenseManager = LicenseManager.GetInstance();
ILicense license = licenseManager.CurrentLicense();
ILicenseFeature feature = license.Features().First(e => e.IsFloating);
license.RegisterFloatingFeature(feature);
// You can find a similar sample in the console sample app 
// that is a part of the SDK.


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

C#
ILicenseManager licenseManager = LicenseManager.GetInstance();
ILicense license = licenseManager.CurrentLicense();
ILicenseFeature feature = license
                           .Features()
                           .First(e => e.FloatingEndDateTime > DateTime.Now);
license.ReleaseFloatingFeature(feature);
// You can find a similar sample in the console sample app 
// that is a part of the SDK.


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.

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#
void WatchdogCallbackMethod(LicenseSpringException e)
{
  // DO SOMETHING
}

license.SetupFloatingFeatureWatchdog(WatchdogCallbackMethod);

// Callback method will be invoked only if an exception in a watchdog thread
// is raised. If you want to invoke the callback on every feature
// registration you can pass an optional parameter to the method:
license.SetupFloatingFeatureWatchdog(WatchdogCallbackMethod, true);


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#
license.StopFloatingFeatureWatchdog();


And once stoped, it can be restarted again:

C#
license.StartFloatingFeatureWatchdog();






Updated 14 Nov 2023
Did this page help you?
PREVIOUS
Floating Licensing
NEXT
User-Based Licensing
Docs powered by Archbee
TABLE OF CONTENTS
Check if a feature is floating
Floating slots
Floating timeout
Registering and releasing floating features
Watchdog setup
Docs powered by Archbee