Linux $timeout

Author: rob.cooper@sanderson.com (robatwork)

We have an 9.06 Uniface application running on Linux (Centos 6.5), is there an ASN setting similar to $timeout to enable an apexit after x seconds of inactivity. Rob

8 Comments

  1. There is not. Please tell us more about your problem so we can help you think of alternative solutions.


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  2. Hi Rob, The $timeout ASN setting is indeed only available on MS Windows and Open VMS (in character mode) and has a limitation of 1 to 60 minutes, allthough I have made an alternative once that covered 1 minute up until (almost) infinity by adding some code to the startup shell and the async trigger. This alternative also only works on Windows, because it still uses the $timeout setting (fixed at 1 minute and then multiplied) as a base, sorry.... But like Theo says, tell us more about what you're trying to achieve and we'll think along with you for alternatives. I'm not completely sure if the Asynchronus Interrrupt trigger works on non-Windows platforms, but if it does, I'm thinking of an alternative using postmessage statements, or something along that line.


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  3. Hi,  We are using the CHR interface on the Centos box for an RF warehousing app, we just want to log the session off after x minutes of inactivity. Regards Rob


    Author: robatwork (rob.cooper@sanderson.com)
  4. Hello Arjen, Sound interesting, would you share your code extending the $timeout? Regards Jean-Luc


    Author: lejolyjl (jean-luc.lejoly@labsolution.lu)
  5. You would have to build a solution yourself, maybe something like this: Use the UTIMER component to send messages to a component at regular intervals. You would have to make some sort of activity counter. Maybe a global variable that you increase each time there is activity. When you get the message you can check if your counter has gone up. If not then you terminate the application.   Determining what you see as "activity" will be the most difficult part.


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  6. Hi Jean-Luc, Please check the Community Samples section... Smile Best regards, Arjen


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
  7. Hi Arjen, Found it. We'll have a look into this. Thanks Jean-Luc


    Author: lejolyjl (jean-luc.lejoly@labsolution.lu)
  8. In addition to the sample I have uploaded, I would like to add that I have chosen my 'base frequency' to be 1 minute, so that the sample is more understandable to everybody. The downside of this 1 minute base frequency is that long time-outs are a sort of addition of several 1 minute cycles, which could lead to less precision for the long haul. As the community samples are a kind of open source, everybody is free to change the base frequency for example to a 15 min. base. In this case multiplying the base frequency by 16 would lead to a 4 hour time out (16 x 15 = 120). Increasing the base frequncy would lead to better accuracy in the long run, but of course less precise definition of the time out (15 min blocks instead of 1 min blocks). Steps to change to a 15 min. base frequency:

    • Define a $TIMEOUT parameter in the [SETTINGS] section of the ASN file. Set it to 15 minutes (instead of the earlier 1 minute)
    • Define a logical "TIMEOUT_LONG" in the [LOGICALS] section of your ASN file. Set the value to an amount in quarters of an hour that suits you, i.e. 16 (instead of 240) to get 4 hours.
    • Change all the comments in the code: search for '1 minute' and replace by '15 minutes' (or '1 quarter of an hour')

    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)