4C Timeouts
4C Timeouts
4C supports timeouts on the server machine and on the client machine.
Both server timeouts and client timeouts can be associated
with either the current program or with the current session.
A 4C server timeout can only be triggered when the 4C server
program is idle and waiting for input.
A 4C client timeout is only triggered when the client is idle
regardless of whether the server is idle or not.
The reasons that both client timeouts and server timeouts are necessary
are:
-
A server may be running a program that continuously refreshes itself
thus preventing any server session timeout from being triggered.
In this case it may be helpful to notice that the client machine
has been idle and exit the client.
-
A user may leave a 4C session sit idle, but continue working in other
applications on the client.
In this case the client timeout would not get triggered, but you may still
wish to have your application notified if the server session is idle
for a certain period of time.
There are several uses for timeouts including but not limited to:
-
Allow graceful exit of an idle session so that resources are freed
-
Lock a client workstation for security purposes.
The easiest way to define a server session timeout is by adding
an entry to XLCONFIG similar to:
-
SvTimeout 7200 [ <prname> ]
For the above, if no <prname> is specified, the 4c server session will exit
if it is waiting for input from the user for more than two hours.
If <prname> is specified, then <prname> will run when the 4c server
session has been waiting for user input for more than two hours.
The easiest way to define a client session timeout is by adding
an entry to XLCONFIG similar to:
-
ClTimeout 7200 [ <prname> ]
For the above, if no <prname> is specified, the 4c client session will exit
if there has been no mouse or keyboard input on the client machine for
at least two hours.
The 4csrvr may continue running if it is still doing useful work.
If <prname> is specified, then <prname> will run when the 4c client
session has been idle for at least two hours.
The only way to specify program timeouts is by calling
sys.set_timeout()
in the program that wants to timeout.
Examples
-
The demo programs demo.main.s, lockscreen.s, lockscreen.warn,
lockscreen.1, and getpwd.1 work together to implement a server session
timeout that hides the current application and requires a password to
unlock the session.
-
The demo programs demo.main.s and lockws.1 work together to implement
a client session timeout that locks the client workstation when the
timeout is exceeded.
Modify the config values by running demo.config.fm and then run
run demo.main.s to see how the above examples work.
Notes:
-
Timeout <n> is equivalent to SvTimeout <n>.
-
Only 4csrvr versions 4.4.8 and higher will recognize SvTimeout and
ClTimeout in XLCONFIG.
-
Client timeouts require both the 4csrvr and 4cclient to be version
4.4.8 or higher.
-
It is not a good idea to specify a session timeout program
for either client or server timeouts in XLCONFIG because
not all applications will be using the same program path.
It is better for your application to set up session timeouts
that need to run a program when the timeout is triggered.
-
When a session timeout is caught and runs a 4C program, the
4C program should disable session timeouts in the InitPCL and re enable
them in the ExitPCL.
-
If your application is using both server and client session timeouts
and running programs when they are triggered,
it is necessary for the server timeout to be less than the client timeout
in order to guarantee that it will be triggered.
This is because once a client timeout is triggered that runs a program,
the server will not be idle and the input wait will start over the
next time the server is waiting on input.
-
Program timeout values should be less than or equal to the session timeout
values or they will never get triggered.
-
If your application uses alarms, it is necessary for the alarm to be
no greater than any current timeout value or it will never get triggered.
-
If you use client session timeouts to exit a client session you really
should enable ContinueWork in _4CSRVRCONFIG.
See Also:
sys.settimeout()
sys.set_alarm()
sys.get_timeoutp()
sys.get_timeoutv()
sys.set_alarm()
sys.lock_clientws()
sys.exit_client()
sys.exit_4c()
Back to Top