Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

Uniface 9: kill interactive uniface appli

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

17 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

I use $timeout with 1 Minute. We close usersessions because of concurrent licenses.   In the "Asynchronous Interrupt"-Trigger of every Startup-Shell there is the following Code : ; ASYNC ; if ($result != "message")  activate "H_ONLINE".exec($formname, $result) endif   In H_ONLINE there is a Code like this:  ; Nach 90 Minuten inaktivität -> Exit  $TIMEDIFF$ = $datim - $LASTTIMEOUT$  $LASTTIMEOUT$ = $datim  if ($TIMEDIFF$[clock] > "00:01:20")   ; Der Anwender war aktiv   $INACTIV$ = 0  else   $INACTIV$ = $INACTIV$ + 1  endif  if ( $logical("Typ") = "PROD" )   if ($INACTIV$ > 90)    ; Zeitlimit erreicht, prüfen ob LOGOUT erfolgen muss    call LP_LOGOUT(90)   endif  else   if ($INACTIV$ > 45)    ; Zeitlimit erreicht, prüfen ob LOGOUT erfolgen muss    call LP_LOGOUT(45)   endif  endif   When the programs start we write a record to the database with Username Computername Application Starttime Endtime Menue Menuetime Each time the user calls a new menue the record is updated. In LP_LOGOUT we check, if the user is running more than one Application. If the user is working in a different Application, there is no need to Exit the actual Application because it is the same License he is using.   If we close the session, we execute an extern EXE which Shows the user that we closed the application for reason of inactivity.   I have the sneaking suspicion that the timeout is not Always fired when the user is inactiv. So Maybe UTIMER would be an alternative if you could request the time of inactivity.   Regards Norbert


Author: Lauterbach (norbert.lauterbach@infraserv.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

to avoid misunderstanding: when last invocation was INSIDE lastTimestamp + epsilon then increment. To determine the epsilon, its good to log the invocations to get a feeling how reliable the $timeout beat is. When developing the concept, I used a $timeout of one minute and (depending on the systems other workload ) some (relatively large) differences. Much fun to try beating the $timeout counter. Uli


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

One option is a mechanism of accumulating consecutive $timeouts: Store timestamp of last $timeout and count invocations. When last invocation was $timeout period ( plus epsilon ) ago, then increment the counter. When the counter reaches the limit, start the action. Otherwise reset counter to 1 (as we have already one event).


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

Iain Sharp said ... If you were to design one, how would you reference it? From outside? Otherwise there would have to be activity on the client to check how long the client was inactive.  ... Iain  

An option could be into "Async trigger" scheduled from $timeout with today range limitation to go over 60 minutes. Gianni


Author: gianni (gianni.sandigliano@unifacesolutions.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

Hi Dominique, Uli / Daniel is correct - I do not run any urouter here at all - the UTIMER object runs in the client only. Knut


Author: Knut (knut.dybendahl@gmail.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

thanks I will use the $timeout, I need  to kill application when offices are closed , so I can test the hour and kill automatically so this is the easiest solution thanks for answers   Dominique


Author: mpservices (mps59@orange.fr)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

as an addition to giannis post: while $TIMEOUT strikes after a given period of inactivity (at least that's what is documented), the UTIMER doesn't care what happens in between in the uniface application. Therefore most just use the utimer activation (each couple of minutes) to increment a counter (and fire action when limit is exceeded) AND have another operation resetting the counter which is called whenever a user activity is encountered. HIH, Uli


Author: ulrich-merkel (ulrichmerkel@web.de)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

Hi Dominique, Uniface has an historical built $timeout parameter to be defined into ASN file; with this parameter Uniface application is exiting closing connection after X minutes, with X in the range 1-60 minutes. IMHO this feature should be extended to larger values (I had requests up to 4hours = 240 minutes) but this is currently a wish. Starting with Uniface9 is available a new feature UTIMER; using this feature you can sets one or more timer(s) that can post messages to a specified component instance. You can find more info on UTIMER into Uniface Library at this link. Using UTIMER you can do whatever you like in your application with specific asyncronous timing. Regards, Gianni


Author: gianni (gianni.sandigliano@unifacesolutions.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

Hi Norbert,  If you were to design one, how would you reference it? From outside? Otherwise there would have to be activity on the client to check how long the client was inactive.  Regards,  Iain


Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:40 AM UTC

kill interactive uniface appli

Author: mps59@orange.fr (mpservices)

Hello How can I kill an uniface appli when the user is not using it after a few hours   Dominique

Hi Norbert, No, not that I'm aware of. There is no public API for this (AFAIK). The timeout is handled in the main program loop of Uniface. Daniel


Author: diseli (daniel.iseli@uniface.com)