Host Simulator

The purpose of the Host Simulator tool is to capture interactions between a terminal and a Telnet server and record the interactions in a trace file. This file can be used to simulate a live connection to the original Telnet server, or to play back those recorded interactions. For instance, you might want to work with host screens offline, or you might want to provide others access to your screens without providing access to the original host. Flow through Host Simulator between terminal and server

Recording sessions

Before you begin recording a session, there is an option related to the Host Simulator console that you should know about and consider. Under the File menu, select Options. There are two selections on the Options menu that are independent of each other. One of the options is Verbose Output. This option controls how much information is displayed in the Host Simulator console. By default, the Verbose Output option is checked, which means you will see more information than when it is not checked. The other option is Playback. The Playback options are defined in the section on Playing back recorded sessions.

To record a trace in Host Simulator, follow these steps:

  1. Start the Host Simulator.
  2. Under the File menu, select Record Mode. (Record Mode is the default mode when you start the Host Simulator.)
  3. In the Save simulation as field, enter the path and name you want to use for the recorded trace file, such as C:\Host Simulator\myhostsim.hsm. You can also use the Browse button to navigate to the directory where you want to save the file, and select or enter a file name.
  4. In the Host name (or IP address) field, type the host name or IP address of the Telnet server you want to use for the simulation.
  5. In the Port field, specify the port number to use for communicating with the Telnet server. The default is 23.
  6. Click Start Recording.

In the Host Simulator console, you should see the message:

 
"Server is listening on port 7021".
Host Simulator recording settings

Setting up HATS to record sessions

To set up HATS to record a trace, follow these steps:

  1. Start HATS.
  2. Highlight a HATS application with which you want to work.
  3. Click the plus sign (+) next to your HATS project.
  4. Double click on Project Settings to open the editor.
  5. Click the Connections tab.
  6. Highlight the connection you want to use and click Edit.
  7. Click the Basic tab.
  8. Set the connection settings as follows:
    Host name: localhost
    Port: 7021
    Type: 3270 or 5250, depending on your host system. 
    
    HATS project settings for recording
  9. Save the settings.

Setup is now complete.

Using HATS to record sessions

You can record HATS sessions either by running an application or using the HATS Host Terminal.

Running HATS applications

To record HATS applications, follow these steps:

  1. Start HATS.
  2. Highlight your application and right click on it.
  3. Select Run on Server.
  4. When the application starts, you should see the following messages in the Host Simulator console:
     
    "Server has accepted a client connection."
    "Connected to the host "your host" at "your port."
    
    HATS application connected to host
  5. Navigate through the screens of your application.
  6. When you have captured the screens of your application, return to the Host Simulator and click Stop Recording.
  7. You should see the following message in the Host Simulator console:
    "Session Ended"
    "Record Session Ended by user"
    
    HATS application recording ended

The trace of the application is recorded in the file named in the Save simulation as field of the Host Simulator.

Capturing interactions using the HATS Host Terminal

To record other interactions outside of your HATS application, follow these steps:

  1. Start HATS.
  2. Highlight and right click on your application.
  3. Select Open Host Terminal.
  4. When the Host Terminal opens, you should see the following messages in the Host Simulator console:
     
    "Server has accepted a client connection."
    "Connected to the host "your host" at "your port."
    
    HATS Host Terminal connected to host
  5. Log on to the host and navigate through the screens you want to capture.
  6. Return to the Host Simulator and click Stop Recording.
  7. You should see the following message in the Host Simulator console:
     
    "Session Ended"
    "Record Session Ended by user."
    
    HATS Host Terminal recording ended

The trace of the HATS session is recorded in the file named in the Save simulation as field of the Host Simulator.

Playing back recorded sessions

Before you begin playing back a recorded session, there are some options affecting the playback that you should consider. Under the File menu, select Options. There are two selections on the Options menu that are independent of each other. One of the options is Verbose Output. The Verbose Output option was described in the section on Recording sessions. The other option is Playback. The Playback options determine the length of time between recorded screens during the playback. The options are:

Time delay
This option determines the type of delay to use during the playback. You might want to specify time delays between the server and the terminal as if network traffic were effecting your communication. The selections are:
No delay
The next screen is displayed when you press the enter key.
Random
The next screen is displayed within a random time for which you specify time limits.
Actual
The next screen is displayed in the same time as when the screens were originally recorded.
Minimum
Defines the minimum amount of time in seconds before the next screen is displayed. This option is only available when you select Random for the Time delay option.
Maximum
Defines the maximum amount of time in seconds before the next screen is displayed. This option is only available when you select Random for the Time delay option.

When you have started the playback, client usage information is available. Under the View menu, select Connection Information. A Client Connection Information window appears and contains the following information:

These values are subject to the recorded session parameters.

To play back a recorded session, follow these steps:

  1. Start the Host Simulator.
  2. Under the File menu, select Playback Mode.
  3. In the Simulation file to play field, enter the path and name of the previously recorded trace file, such as C:\Host Simulator\myhostsim.hsm. You can also use the Browse button to navigate to the directory where you have stored a recorded file, and select the file name.
  4. In the Port field, specify the port number that you specified when the session was recorded. The default is 23.
  5. Click Start Playback.

In the Host Simulator console, you should see the message:

 
"Server is listening on port 23".
Host Simulator listening for input

Playing back sessions using the Host Terminal

To play sessions on the HATS Host Terminal, follow these steps:

  1. Start HATS.
  2. Highlight a HATS application.
  3. Click the plus sign (+) next to your HATS project.
  4. Double click on Project Settings to open the editor.
  5. Click the Connections tab.
  6. Highlight the connection you want to use and click Edit.
  7. Click the Basic tab.
  8. Set the connection settings as follows:
    Host name: localhost
    Port: 23
    Type: 3270 or 5250, depending on your host system. 
    
    HATS project settings for playback
  9. Save the settings.
  10. Highlight and right click on your application.
  11. Select Open Host Terminal.
  12. When the Host Terminal opens, you should see the following message in the Host Simulator console:
     
    "The server has accepted a connection from "your host"."
    
    where "your host" is either the host name or the IP address of the machine where the playback will be displayed. Host Simulator ready for playback

Command line options

Besides launching the Host Simulator tool from the Start menu, it may also be launched from a command prompt. The general form of running the tool from a command prompt is as follows:

java -classpath %CLASSPATH%;hostsim.jar com.ibm.HostPublisher.HostSim.Hostsim [filename] [mode] [port] [time delay] [server] [minimum] [maximum] 

Note: This command assumes that a supported Java VM is included in your command path and that you are issuing this command from the directory where the tool was installed.

The order of the arguments is important. For example, to specify the mode, you must also specify the filename.

Description of command line arguments
Argument Description
filename The relative or full path of the trace file being recorded or played back. Enclose long filename paths in double quotes.
mode Specifies the initial startup mode. Valid values: RECORD or PLAYBACK
port During playback, specifies the TCP/IP port to listen on for client connections. For recording, specifies the TCP/IP port of the telnet server (typically 23).
time delay Specifies the playback time delay. Valid values: NONE, RANDOM, or ACTUAL.
server Specifies the IP address or host name of the telnet server; only applicable during recording.
minimum Specifies the minimum delay (in seconds); only applicable when the time delay argument is set to RANDOM.
maximum Specifies the maximum delay (in seconds); only applicable when the time delay augment is set to RANDOM.

Copyright International Business Machines Corp. 2004. All rights reserved.

No part of this publication may be reproduced, photocopied, stored on a retrieval system, transmitted, or translated into any language without the express written consent of the publisher:

International Business Machines Corp.
P.O. Box 12195
Research Triangle Park, NC 27709-2195
USA

Note to U.S. Government Users - Documentation related to restricted rights - Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp.

This program is provided as is; IBM is not responsible for any mishaps to persons or property caused by the usage of Host Simulator.