The Georgia SoftWorks Windows Universal Terminal Server is outstanding in the case of a link or remote PC failure we attempt to gracefully terminate the executing DOS application, therefore saving important data that may otherwise be lost. Many applications are terminated by sending a sequence of characters to the application such as ESC-ENTER. Applications may have specific sequences. We allow a termination string to be defined as an environment variable in the k_start.bat or c_start.bat file. When a session is to be terminated due the client heartbeat timer expiring or the server side inactivity timer expiring then the defined termination string will be sent to the associated application. Approximately 3 seconds later the session is terminated if still running.
The termination string is a comma delimited list of keystrokes that you want to send to the shell ( or your application) before it is terminated due to either the Client Heartbeat timeout or the Server Side Inactivity timeout. No extra white space is allowed. The string is not case sensitive. For example you must specify 'shift-c' to produce a capital 'C'.
Note: Termination String Syntax is also used with GSW Mobile Client Macros when remapping function keys.
The following control key designators are defined.
• shift-This special operator will pause the output to the shell for xx seconds. This gives the application time to process the input. This is very useful when saving files to disk and for applications that flush the keyboard buffer. By default a 1-second pause is injected between keystrokes, however some specific cases may require the use of the Sleepxx operator to introduce additional delay.
To ensure graceful termination you may want to enter the string "e,x,i,t,ENTER" to exit the shell. Once the specified application is terminated by the user-specified string, the above string will complete the graceful termination process. This string sends the command exit and then enter [20] which are the commands to terminate a session. You must be sure that the user defined termination string does indeed terminate the application before sending the "e,x,i,t,ENTER" string otherwise unintended characters will be sent to the application.
We will continue to use the amortization program from the previous example. However, we will assume that a standard menu exists for the application. A File menu item exists that is invoked by alt-f. The list of items in the File menu list includes s for saving the work and alt-f for opening the file menu list again and then x for exiting the application. Next follows the ",e,x,i,t,ENTER" to gracefully close the shell.
Now when the User ID "bill" connects to the Windows system via SSH2/Telnet the application amortize.exe will automatically be executed. If the session is terminated due to system timeouts the termination string alt-f,s,sleep5,alt-f,x will cause the following sequence of events to occur.
First Alt-f to be sent to the application (This opens the file menu).
Second s is send to the application (for saving the file).
Third, the Sleep5 causes 5-second pause to allow the application time to save the files,
Fourth alt-f to open the file menu list again,
Fifth an x is sent to the application to exit.
Finally ",e,x,i,t,ENTER" is send to the shell which terminates the session.
Other examples of termination string definitions are [21]: