kill interactive uniface appli | Uniface 9 | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
kill interactive uniface appli
29 Oct 2018
10:56 am
Avatar
mpservices
Member
Forum Posts: 35
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hello

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

 

Dominique

29 Oct 2018
1:01 pm
Avatar
gianni
Member
Forum Posts: 357
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

29 Oct 2018
2:20 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1890
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

29 Oct 2018
4:18 pm
Avatar
mpservices
Member
Forum Posts: 35
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

30 Oct 2018
10:14 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1890
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Dominique,

if you use the timer only to invoke your check procedure but do not really care about users inactivity,
I would recommend to activate this procedure based on UTIMER for the following reasons:

– doesn’t need any special ASN settings to enable the forced layout (no $TIMEOUT specified, no checks)
– depending on a special keyword in the commandline, you can disable this forced logout in the startup shell
– it allows intervals longer than 60 minutes

Allover, much more flexibility with less demands on the ASN file used,

Uli

30 Oct 2018
1:29 pm
Avatar
Knut
Member
Forum Posts: 229
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Dominique,

If I understand correctly, you’d like to ‘force’ the user off (logoff) after the offices close.
I presume all offices close at a certain time (like 5pm)?

variables
time vt_delay, vt_close
endvariables

activate "UTIMER".setmessage("yourcomponent", "", "LogMeOff")
vt_close = "17:30:00"
vt_delay = vt_close – $clock
activate "UTIMER".start(vt_delay)

We have a ‘master’ component being run from the application startup shell.
‘yourcomponent’ above is that said master component – thus when the timer
kicks in – we end up in the ASYNC trigger of ‘yourcomponent’…
Then, apexit rules the day.

Good luck,
Knut

31 Oct 2018
7:41 am
Avatar
mpservices
Member
Forum Posts: 35
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Thanks Knut

But I saw in documentation that utimer needs urouter, which I’m not using

So I think this solution doesn’t suit to me

Dominique

31 Oct 2018
8:28 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1890
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Dominique,

I think you have misinterpreted the info from the helpfile as “exclusive server” is a special context.

The UTIMER can run in an exclusive server but it can only post messages to applications that are registered with the Uniface Router

I had no problem using UTIMER in C/S without any UROUTER running,
Uli

31 Oct 2018
8:35 am
Avatar
diseli
Admin
Forum Posts: 1045
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Dominique,

If you’re using the UTIMER on the client side of an application then the URouter is not needed. Only when you want to use the UTIMER from a component that is running remotely in a UServer process then the URouter is required. The UServer does not have it’s own message queue that could handle asynchronous messages. The queuing is down by the URouter.

Hope this helps.

Daniel

31 Oct 2018
9:49 am
Avatar
Lauterbach
Member
Forum Posts: 59
Member Since:
06 Dec 2012
sp_UserOfflineSmall Offline

Hi Daniel,

is there a Uniface-Function to get the time of inactivity?

Uniface needs to know this value otherwise it could not fire the $timeout.

 

Norbert

31 Oct 2018
10:33 am
Avatar
diseli
Admin
Forum Posts: 1045
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

31 Oct 2018
10:38 am
Avatar
Iain Sharp
Member
Forum Posts: 680
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

01 Nov 2018
3:45 pm
Avatar
Knut
Member
Forum Posts: 229
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Dominique,

Uli / Daniel is correct – I do not run any urouter here at all – the UTIMER object runs in the client only.

Knut

02 Nov 2018
8:18 am
Avatar
gianni
Member
Forum Posts: 357
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

02 Nov 2018
9:56 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1890
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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).

02 Nov 2018
10:04 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1890
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

02 Nov 2018
4:28 pm
Avatar
Lauterbach
Member
Forum Posts: 59
Member Since:
06 Dec 2012
sp_UserOfflineSmall Offline

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

05 Nov 2018
10:18 am
Avatar
Iain Sharp
Member
Forum Posts: 680
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

gianni said

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  

Oh yes, that’s how you would use $timeout to do the job, but the O.P. was looking for a function to query how long the session was inactive, and I was pointing out that the query itself would be activity (as would the loop it was in) so within a client, the answer would always be 0. 

With the urouter in place, you can use the UROUTMON signature to query client status, which will return an idle time, but the client doing the query is never idle… 

 

Iain

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1890

Iain Sharp: 680

Theo Neeskens: 371

gianni: 357

Adrian Gosbell: 318

istiller: 299

rogerw: 272

Knut: 229

lalitpct: 197

Arjen van Vliet: 184

Member Stats:

Guest Posters: 3

Members: 10982

Moderators: 0

Admins: 6

Forum Stats:

Groups: 1

Forums: 62

Topics: 2323

Posts: 10052

Newest Members:

greentipodent1976, NicolasHib, gipipufen1981, Alfredvax, Lesterpioto, crystalst3, otogsa12, Ramonmaw, harolddz1, Lariskawo

Administrators: admin: 23, diseli: 1045, Nico Peereboom: 84, richiet: 406, Mike Taylor: 38, JanCees: 39