List of all headless clients

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

List of all headless clients

Postby steve1376656734 » Tue Mar 08, 2022 4:12 pm

Hi,

Does anyone know of a way to get a list of all the headless clients? I have looked at plugins.headlessclient and plugins.clientmanager but neither of them seem to have a method to allow this.

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 271
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: List of all headless clients

Postby robert.edelmann » Wed Mar 09, 2022 2:19 am

I didn't find a way to just get the headless clients, but we create usage-logs like this:

Code: Select all
var listClients = plugins.clientmanager.getConnectedClients();
for (var indClients = 0; indClients < listClients.length; indClients++) {
    var clientInfo = listClients[indClients];
    if (clientInfo.getApplicationType() == APPLICATION_TYPES.HEADLESS_CLIENT) {
        headlessClientsAll++
        continue;
    }
    var clientUserOrgID = clientInfo.getUserUID();
    if (!clientUserOrgID) {
        continue;
    }
......
}


We just count the headless-clients and don't do much more, but you could probably get more infos from the clienInfo-Object, like the name with clientInfo.getOpenSolutionName().
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 41
Joined: Wed Aug 14, 2013 6:12 pm

Re: List of all headless clients

Postby steve1376656734 » Wed Mar 09, 2022 1:31 pm

Thanks Robert - was looking for a method specifically for headless clients and never considered just iterating all the connected clients.
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 271
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 0 guests