TN3270 Server Manual

CRT Communication Protocol
TN3270 Server Manual424097-001
5-3
CONTROL 22 Operation
CONTROL 22 Operation
Use the CONTROL operation to perform device-dependent I/O operations.
For a normal file system READ request, the READ call COUNT parameter specifies
how much buffer space the file system must allocate for the duration of the READ
request. Data buffer space can be exhausted quickly when many subdevices exist
simultaneously for a given configuration and each subdevice has one or more
outstanding READ requests of substantial size.
Instead of issuing a normal READ request, the Guardian TN3270 Server issues a
CONTROL 22 operation, which initiates a two-step READ operation designed to
conserve buffer resources. A CONTROL 22 operation, or a forerunner to a READ
procedure, commits file system buffer resources only when the Guardian TN3270
Server has data from the client. When the Guardian TN3270 Server receives data from
the event, it notifies the application by completing the CONTROL 22 operation request
and the application immediately issues a READ request to get the data.
When a text message is received or a line error occurs, the CONTROL 22 operation
request completes by returning file system error 0 if the read was successful, or returns a
specific error number if the read was not successful. If the file system error is 0, a read
must be issued as soon as possible to pick up the input buffer. The read count parameter
of the READ procedure is checked to see that it is greater than or equal to the actual
count read from the device. If the read count parameter is less than the actual read count,
a file system error 177 (text overrun; insufficient buffer space for data transfer) is
returned to the application process, but no data is returned.
If another CONTROL 22 operation is issued by the same opener before the first
operation is complete, a file system error 88 (a CONTROL READ is pending; a new
READ is invalid) is returned.
If a CONTROL 22 operation is complete and the application program logic tries to
discard the received data without issuing a READ request, the application program may
issue a CONTROL 22 operation with the parameter set to -1. The Guardian TN3270
Server interprets this as a “discard data” request, and releases the data buffer.
If the CONTROL 22 operation portion of a two-step READ request is complete and a
request other than a READ (or a CONTROL with a parameter of -1) is issued, a file
system error 87 (awaiting a new READ request but did not receive it) is returned.
The following restrictions apply when using a two-step READ operation:
A forerunner request for a particular opener might not be queued behind forerunner
or READ requests from the same opener.
If a forerunner is issued immediately after another forerunner successfully
completes (when a read is expected), the second forerunner is rejected.
No further READ or WRITE requests will be posted for the subdevice (that is, the
READ request is blocked) until pending data is read by the opener that issued the
forerunner (or until that opener is closed).
No timeout is imposed on the READ operation. The buffer remains queued until the
read from the proper OPENID is received or until that opener closes. The READ