hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP TCP/IP Services for OpenVMS

HP TCP/IP Services for OpenVMS
User's Guide


Previous Contents Index

4.4 Exiting TELNET and TN3270

You can end a TELNET or TN3270 session (close the connection) in one of the following ways:

The following example shows two ways to close connections:


% logout 
%TELNET-S-REMCLOSED, Remote connection closed 
-TELNET-I-SESSION, Session 01, host galaxy, port 23 
TELNET> 
 
TELNET> EXIT 
$ 
% [Ctrl/]] (characters not echoed) 
TELNET> DISCONNECT 
galaxy.udp.com> 
TELNET> DISCONNECT 
%TELNET-S-LCLCLOSED, Local connection closed 
-TELNET-I-SESSION, Session 01, host galaxy, port 23 
TELNET> 

4.5 Keeping a Log of Your TELNET Session

To keep a log of your TELNET session, use the /LOG_FILE qualifier. (You cannot use this qualifier with a TN3270 session.)

The following example establishes a TELNET connection to node central , sets the terminal type to VT200, and logs all session output to the file CENT.LOG in your current directory.


$ TELNET/LOG_FILE=CENT.LOG/TERMINAL_TYPE=VT200 CENTRAL 

4.6 Command Procedures

With DCL command files, you can start TELNET and TN3270 sessions (see Section 4.6.1) and customize the TELNET/TN3270 environment (see Section 4.6.2).

4.6.1 Starting TELNET/TN3270

You can create a command procedure containing the DCL commands DEFINE and TELNET (or TN3270) commands.

The following shows an example of a TELNET command procedure:


$! My TELNET startup command file, START_TELNET.COM. 
$! 
$! This command procedure establishes a TELNET session 
$! with UNIX host central. 
$! 
$ DEFINE /USER_MODE SYS$INPUT TT: 
$ TELNET CENTRAL 

4.6.2 Initialization Command Files

You can create initialization command files to customize your TELNET/TN3270 sessions with SET, ENABLE, and DISABLE commands. These command files:

The following example shows a TELNET initialization command procedure:


! This file, TELNETINIT.INI, sets my TELNET parameters 
! the way I like them. 
! 
DISABLE AUTOFLUSH 
ENABLE BINARY 
ENABLE DEBUG 
SET DEVICE /TERMINAL=VT300 
SET ESCAPE "^p" 

4.7 Toggling Between the Remote Host and Local TELNET/TN3270

During a session with a remote host, you can toggle between the local TELNET or TN3270 process and the connected host. For example, at the TELNET prompt, you might want to display status, modify a TELNET parameter, or spawn a DCL subprocess.

The following example toggles between remote UNIX host biway and the local OpenVMS system.


biway> [Ctrl/]]  (characters not echoed) 
TELNET> SHOW STATUS 
Session  1 Active  Host biway Port 23 
    Operating Mode: Character-at-a-time 
    Escape character: '^]' 
    Options: 
       Echo - Remote 
       Terminal Type - Local 
       Terminal Type - VT300 
       Suppress Go Ahead - Local 
       Suppress Go Ahead - Remote 
    Terminal Dataoveruns:    0 
    Suspended Network I/Os:  0 
              
   .
   .
   .
TELNET>  [Return] 
biway> 

In the next example, user BENTLEY, working at OpenVMS node EAGLE, uses TELNET to do the following:

  1. Establish a connection to UNIX host fern .
  2. Return to the local TELNET prompt.
  3. Display status.
  4. Establish a connection to host gannet .
  5. Return to the TELNET prompt.
  6. Display status.
  7. Connect to sands . But sands closes the connection because BENTLEY incorrectly enters the password three times.
  8. Try to resume the session with gannet . However, RESUME without specifying a session number fails:


$ TELNET FERN 
   .
   .
   .
fern> [Ctrl/]]   (characters not echoed) 
 
TELNET> SHOW STATUS  
Session  1 Active  Host FERN 
   .
   .
   .
TELNET> CONNECT GANNET 
   .
   .
   .
gannet> [Ctrl/]] (characters not echoed) 
TELNET> SHOW STATUS 
Session  2 Active  Host GANNET 
    Operating Mode: Character-at-a-time 
    Escape character: '^]' 
   .
   .
   .
Session  1 Waiting Host FERN 
 
TELNET> CONNECT SANDS 
%TELNET-I-Trying, Trying...11.18.222.95 
%TELNET-I-SESSION, Session 03, host sands, port 23 
-TELNET-I-Escape, Escape character is '^]'. 
   .
   .
   .
 
 
Username: BENTLEY 
Password: 
User authorization failure 
Username: BENTLEY 
Password: 
User authorization failure 
Username: BENTLEY 
Password: 
User authorization failure 
 
Remote connection closed 
 
 
TELNET> RESUME 
No current session 
TELNET> SHOW STATUS 
 
Session  1 Waiting Host FERN 
Session  2 Waiting Host GANNET 
   .
   .
   .
 
TELNET> RESUME 2 
 
gannet> [Ctrl/]]   (characters not echoed) 
TELNET> SHOW STATUS 
Session  2 Active  Host GANNET 
    
    Operating Mode: Character-at-a-time 
    Escape character: '^]' 
 
   .
   .
   .
 
Session  1 Waiting Host FERN 
TELNET> 
 

4.8 Suspending TELNET to Return to the Local DCL Prompt

While using TELNET, you can use the SPAWN command to suspend your current session and create a subprocess at the local DCL prompt. At the DCL prompt, you can then enter any number of DCL commands. To return to your suspended TELNET session (exiting the DCL subprocess), enter the LOGOUT command.

In the following example, the user suspends the TELNET session to list the files in the working directory on the local host and deletes one of the files in that directory and then returns to the TELNET session.


TELNET> SPAWN 
$ DIR 
   .
   .
   .
$ DEL TR3.TXT:* 
$ LOGOUT 
Process FERN_1 logged out at 17-JAN-2002 11:08:24.90 
TELNET> 
 

4.9 Multiple Sessions

TELNET supports:

The TELNET command SHOW STATUS helps you keep track of multiple sessions. The SHOW STATUS display uses the terms shown in Table 4-2.

Table 4-2 Terminology Used in TELNET Command SHOW STATUS Display
Term Meaning
Active host Host from which you entered the escape sequence to return to the TELNET prompt.
Current session If you log out of the active host at its system prompt, or enter the TELNET command DISCONNECT, no current session exists.

To resume a connection, even if only one exists, enter the following command:
TELNET> RESUME
n

Waiting hosts Other hosts with whom you have open sessions, numbered in the order that you connected to them.

To resume a connection with a waiting host, even if only one exists, enter the following command:
TELNET> RESUME
n

To open another TELNET connection, perform the following steps:

  1. At the system prompt of the remote host, enter the TELNET escape sequence (default is Ctrl/]).
  2. TELNET returns to the TELNET prompt.
  3. Start another session by issuing the CONNECT command.

The following example starts multiple sessions with UNIX hosts finder and keeper .


$ TELNET FINDER 
   .
   .
   .
finder> () 
   .
   .
   .
finder> [Ctrl/]]     (characters not echoed) 
TELNET> CONNECT KEEPER 
   .
   .
   .
keeper> () 
   .
   .
   .
keeper> [Ctrl/]]     (characters not echoed)  
TELNET> () 

4.9.1 Toggling Between Open Sessions

To toggle between one open TELNET connection and another:

  1. Enter the TELNET escape sequence.
  2. If necessary, use the SHOW STATUS command to check the number of your session with the other host.
  3. Enter the TELNET RESUME n command, where n is the number of the session to which you want to return.

For an example, see Section 4.7.

4.9.2 Displaying Session Information

To display a list of your active sessions, use the following SHOW SESSION command:


TELNET> SHOW SESSION [Return]
Session 01, host finder, port 23 
Session 02, host keeper, port 23 (default active session) 

If there are no active connections, the SHOW SESSION command displays the following message:


%TELNET-E-NOSESSION, No active session 

4.10 Customizing TELNET/TN3270 Transmissions, Control Characters, and Displays

To customize the TELNET/TN3270 processing environment, use the ENABLE, DISABLE, and SET commands. You can modify how TELNET and TN3270 perform the following actions:

You can redefine the following control characters, in situations when, for example, your terminal or the remote host does not recognize the corresponding default control character.

Use the SET command to redefine these characters. For example, the following command defines the interrupt character to be the letter a or A.


TELNET> SET INTERRUPT "^a" 

TN3270 allows you to redefine your keyboard. You can redefine most IBM 3270 model functions and all emulated functions and characters. You can create a key definition file with DEFINE/KEY statements to redefine the keyboard. Alternatively, you can redefine a key interactively by using the DEF KEY function (Ctrl/K on VT100-and VT200-series terminals) (see Section 4.12.9.)

You can determine the mode TELNET uses to transmit data. The appropriate TELNET mode for a session depends on:

Table 4-3 shows the modes that control TELNET communications.

Table 4-3 TELNET Transmission Modes
Mode Function
Local Characters Mode The local host interprets control characters, translating them to TELNET protocol sequences (ENABLE LOCAL_CHARS). Use this mode when the local and remote hosts implement different control characters. By default, characters are interpreted by the remote host (DISABLE LOCAL_CHARS).
Binary Mode The local host sends transmissions in binary mode (ENABLE BINARY). Use this mode when the remote host expects each line of data to end with a carriage return/line feed combination. By default, the local host sends transmissions with the end-of-line (EOL) character mapped to the carriage return/line feed combination (DISABLE BINARY).
Debug Mode TELNET displays data flow in both hexadecimal and readable text (ENABLE DEBUG). By default, TELNET displays data in readable text only (DISABLE DEBUG).
Character Transmission Mode TELNET transmits data one character at a time (SET MODE CHAR) rather than line by line. Use this mode when you run a text editor (on the remote host) that does character processing. Character transmission mode is the default.
Line Transmission Mode TELNET transmits data one line at a time (SET MODE LINE). Most clients send a character at a time. The remote host server must support line transmission mode.

This allows you to do signal trapping as well as local-character editing and tab expansion.

4.11 Sending Commands to the Connected Remote Host

While in input mode (an active session with a remote host), you can enter SEND commands that affect the remote host's processing of commands you have entered. You use these commands when the remote host does not recognize the default key or key sequence used for the same operation. You can use the SEND AYT and SEND NOP commands to determine whether or not your session with the remote host is still open. Table 4-4 lists the functions available to you at the remote host with each SEND command.

Table 4-4 Sending Commands to the Remote Host
Function Command When to Use
Abort output of the last remote command you entered, without discontinuing execution of the process. SEND AO You want to terminate output but not the execution of the process.
After already aborting output, you want to resume output. The remote host does not recognize the Ctrl/O sequence as the flush output character.
Determine if your connection with the remote host is still established. The remote host replies with connection status information. SEND AYT Test the connection to the remote host application and verify that the remote host application is responding. You are notified on success.
Terminate execution of the last command you entered at the remote host. SEND BRK The remote host does not recognize the Ctrl/C sequence as an interrupt character.
Delete the last character you entered at the remote host. SEND EC The remote host does not recognize your Delete key.
Delete the last line of text you entered at the remote host. SEND EL The remote host does not recognize your Delete key or command-line recall.
Signal the remote host that your local system is ready. SEND GA The application requires GA commands in either one or both directions.
Interrupt execution of the last command you entered at the remote host. SEND IP Your terminal or the remote host does not recognize the default interrupt character (Ctrl/C).
Determine whether your local host can send data to the connected remote host and whether the remote host can receive that data. SEND NOP Check the communication path to the remote host. You are notified on error.
Interrupt the current process you are executing at the remote host, and in urgent mode (out-of-band), get a quicker response time to the interrupt. SEND SYNCH You want to clear immediately the communications path between your system and the remote host, with the remote host ignoring any incoming data not yet processed.

4.12 IBM 3270 Model Terminal Emulation (TN3270)

You can run a TELNET session with a host that uses IBM 3270 model terminals by using the TN3270 command. The TN3270 command:

During a TN3270 session, you can do the following:

Note

When you run TN3270, you can only have one session. You cannot have other sessions running simultaneously, as you can when running normal TELNET sessions.

4.12.1 Supported IBM Terminal Models

Table 4-5 lists the IBM 3270 terminal models that TELNET/TN3270 can emulate.

Table 4-5 TELNET --- IBM 3270 Model Terminals Supported for Telnet/TN3270
Model Screen Size (Rows x Columns)
IBM 3278 Model 2 24 x 80
IBM 3278 Model 3 32 x 80
IBM 3278 Model 4 43 x 80
IBM 3278 Model 5 27 x 132

4.12.2 Setting Up Your PC or Terminal for IBM 3270 Terminal Emulation

When you use TELNET and specify IBM 3270 model terminal emulation (TN3270), the image displayed on your screen depends on the following criteria:

Sections 4.12.2.1 and 4.12.2.2 explain how to set up VT200- and VT100-series terminals (or emulation on PCs), respectively.

4.12.2.1 VT200-Series Terminal Setup

To set up a VT200-Series terminal for emulation, follow these steps:

  1. At the Set-up Directory menu, select the keyboard type that corresponds to the keyboard layout you are using (for example, North American).
  2. At the Display Set-up menu, select the following:
  3. At the General Set-up menu, select the following:
  4. At the Communications Set-up menu, select the following:
  5. At the Keyboard Set-up menu, select warning bell ON.

At the DCL prompt, enter the following command:


 $  SET TERMINAL /INQUIRE 

The software determines the terminal's characteristics and sets the appropriate parameters.

If you select National character mode, enter the following command:


$ SET TERMINAL /NOEIGHTBIT 


Previous Next Contents Index