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 server docid\ ss5gx73i5cjordgk1ed8i 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 licensing docid\ yazxsl7fnxbyi883jyc3 floating client identifier the floating client or instance identifier can be accessed through a license object by using string floatingclientid = license >floatingclientid();string floatingclientid = license floatingclientid();if let id = license floatingclientid { }client id = license floating client id() print(client id) 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 license license = floatingclient >registerlicense( id, licenseid );let floatingclient = floatingclient(configuration configuration) let license = try floatingclient register(userid "user id")#floating client from licensespring floating server import floatingapiclient api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client register user( product="lkprod1", user="user 1", os hostname="bla", ip local="bla", user info="bla", license id=1728377159207169 ) print(response) \#floating manager from licensespring licensefile config import configuration from licensespring licensefile floating manager import floatingmanager conf = configuration( product=product, api key="arbitrary", shared key="arbitrary", file key="your file key", file iv="your file iv", api domain="api domain", api protocol="http/https", ) fs manager = floatingmanager(conf=conf) license = fs manager register() 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 bool unregistered = floatingclient >unregisterlicense( id, licenseid );bool unregistered = floatingclient unregister( id, licenseid );try floatingclient unregister(userid "user id")#floating client from licensespring floating server import floatingapiclient response = api client unregister user(product="lkprod1",user="user 1",license id=1728377159207169) print(response) \#floating manager from licensespring licensefile config import configuration from licensespring licensefile floating manager import floatingmanager conf = configuration( product=product, api key="arbitrary", shared key="arbitrary", file key="your file key", file iv="your file iv", api domain="api domain", api protocol="http/https", ) fs manager = floatingmanager(conf=conf) \# there are multiple options to unregister a license \# 1 floating client > this one is documanted fs manager unregister() \# 2 1 license object > deactivate method license deactivate() \#2 2 license object > floating release license floating release(false) 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 license license = floatingclient >borrowlicense( id, borrowenddatetime );try license borrow(for 24 60 60) // 1 day # floating client from licensespring floating server import floatingapiclient api client = floatingapiclient(api protocol="http", api domain="localhost 8080") response = api client borrow( product="lkprod1", user="user 1", borrowed until="2029 05 06t00 00 00z", os hostname="bla", ip local="bla", user info="bla", license id=1728377159207169, ) \# floating manager from licensespring licensefile config import configuration from licensespring licensefile floating manager import floatingmanager conf = configuration( product=product, api key="arbitrary", shared key="arbitrary", file key="your file key", file iv="your file iv", api domain="api domain", api protocol="http/https", ) fs manager = floatingmanager(conf=conf) license = fs manager borrow("2031 05 06t00 00 00z") \# borrow can be also used within the license object license floating borrow("2031 05 06t00 00 00z") 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 docid\ yazxsl7fnxbyi883jyc3 floating server and license information a helper method for checking the connection the floating server is provided within the floatingclient object bool online = floatingclient >isonline();bool online = floatingclient isonline();let online bool = floatingclient checkconnection()from licensespring licensefile config import configuration from licensespring licensefile floating manager import floatingmanager conf = configuration( product=product, api key="arbitrary", shared key="arbitrary", file key="your file key", file iv="your file iv", api domain="api domain", api protocol="http/https", ) fs manager = floatingmanager(conf=conf) response = fs manager is online() 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 floatingserverinfo floatingserverinfo = floatingclient >getserverinfo();floatingserverinfo floatingserverinfo = floatingclient getserverinfo(); 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 license license = floatingclient getlicenseinfo(); 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 docid\ es5anhxoa67autsvie2p5 documentation for more information