ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/vt3a.htm

169 lines
6.1 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Virtual Terminal Run-Time Example</title>
<!-- Begin Header Records ========================================= -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- VT3A SCRIPT A converted by B2H R4.1 (346) (CMS) by HOLTJM at -->
<!-- RCHVMW2 on 5 Feb 1999 at 07:55:19 -->
<!-- File cleanup completed Sept 2001 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>Virtual Terminal Run-Time Example</h2>
<p>To help understand how virtual terminal APIs are used, the following example
shows how the i5/OS<SUP>(TM)</SUP> operating system, server program, client program, and work
station device (display and keyboard) interact when processing a system
request.</p>
<p>This example starts with the server program waiting for a response from the
client program, which is waiting for data from the user (keyboard).</p>
<ol>
<li>System request processing starts when you press the appropriate System
Request key on the work station keyboard.<br>
<br>
</li>
<li>The client program informs the server program that the System Request key
has been pressed. The protocol used in this case is unique to the particular
implementation of these two programs.<br>
<br>
</li>
<li>The server program calls the Write to Virtual Terminal (QTVWRTVT) API for a
write request. The flag for the System Request key must be set for this write
request. No data is sent to the virtual terminal at this time.<br>
<br>
</li>
<li>The i5/OS licensed program creates a data queue entry for informing the
server program that data is available to be read.<br>
<br>
</li>
<li>The server program removes the entry from the data queue by calling the
Receive Data Queue (QRCVDTAQ) API and then calls the Read from Virtual Terminal
(QTVRDVT) API for a read request. The Cancel Invite operation code is returned.
No data is received from the virtual terminal at this time.
<p>To prevent the client program from sending anymore data (screens), the
server program informs the client program that it is no longer receiving data
from the client program.</p>
<p>The server program calls the QTVWRTVT API for a write request. The Operation
Code parameter is set to Cancel Invite. No data is sent to the virtual terminal
at this time.</p>
</li>
<li>The i5/OS licensed program creates a data queue entry for informing the
server program that data is available to be read.<br>
<br>
</li>
<li>The server program removes the entry from the data queue by calling the
QRCVDTAQ API and then calls the QTVRDVT API for a read request. A Save Screen
operation code is returned. No data is received from the virtual terminal at
this time.
<p>The server program gets the current screen. This may require requesting the
current screen from the client program.</p>
<p>The server program calls the QTVWRTVT API for a write request, sending the
current screen to the virtual terminal. The Operation Code parameter must be
set to Save Screen.</p>
</li>
<li>The i5/OS licensed program creates a data queue entry for informing the
server program that data is available to be read.<br>
<br>
</li>
<li>The server program removes the entry from the data queue by calling the
QRCVDTAQ API and then calls the QTVRDVT API for a read request. A Put/Get
operation code is returned. The data read will be the actual System Request
menu.
<p>The server program sends this data to the client program and waits for a
response.</p>
</li>
<li>The client program updates the display with the System Request menu and
waits for a response from the user. The resulting response is sent to the
server program.<br>
<br>
</li>
<li>The response is received from the client program, and the server program
calls the QTVWRTVT API for a write request, sending the response to the virtual
terminal.
<p><strong>Note:</strong> What happens at this point depends on the response to
the System Request menu. Additional data may be received from and sent to the
virtual terminal. After the response is processed, the following steps
occur.</p>
</li>
<li>The i5/OS licensed program creates a data queue entry for informing the
server program that data is available to be read.<br>
<br>
</li>
<li>The server program removes the entry from the data queue by calling the
QRCVDTAQ API and then performs a call to the QTVRDVT API for a read request. A
Put operation code is returned. The data read is the saved (current) screen
that was previously written by the server program to the virtual terminal.
<p>The server program sends the saved screen to the client program but does not
wait for a response.</p>
</li>
<li>The client program updates the work station display with the saved
screen.<br>
<br>
</li>
<li>The i5/OS licensed program creates a data queue entry for informing the
server program that data is available to be read.<br>
<br>
</li>
<li>The server program removes the entry from the data queue by calling the
QRCVDTAQ API. An Invite operation code is returned. Note that no data is
received from the virtual terminal at this time.<br>
<br>
</li>
<li>The client program is once again waiting for user data, and the server
program is waiting for data from the client program.</li>
</ol>
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center">
<a href="#Top_Of_Page">Top</a> |
<a href="vt1a.htm">Virtual Terminal APIs</a> |
<a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>