|
|
SNA IMF Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 Intrinsics Used with Standard MPE
I/OREADSTREAM |
|
READSTREAM reads all or part of the untranslated host data stream.
To use the READSTREAM intrinsic, open a device in transparent mode by calling the OPEN3270 intrinsic with bit 14 of the flags parameter set to 1. With SDLC protocol, data received from the host is contained in the Request Unit (RU). The RU is preceded by some header bytes known as the Request Header (RH). The RU contains the data stream commands and the data. Each LU.T2 and LU.T3 RU (or each RU chain, if RU chaining is used) from the host contains a 3270 data stream command. LU.T1 RUs contain SCS control codes instead of 3270 data stream commands. SNA IMF removes the RH bytes and stores the rest of the RU in the internal screen image. For LU.T2 and LU.T3 sessions, the first byte in the internal screen image is the 3270 data stream write command. To obtain host data, first call the RECV3270 intrinsic, and then call the READSTREAM intrinsic. After calling RECV3270, the stream of data received from the host is buffered in the internal screen image. Calling READSTREAM retrieves the data from the internal screen image. You can access all or any part of the RU through the READSTREAM intrinsic. If the host attempts to write more data to your internal screen image before you have called RECV3270 to retrieve the data already stored there, SNA IMF rejects the command with sense code X'0820', "device busy." This rejection prevents the host from writing over a data stream that you have not received. You should call RECV3270 and READSTREAM for every RU received. The READSTREAM intrinsic can be called only in transparent mode. See Chapter 2 “Using SNA IMF Intrinsics” for more information about transparent mode. CALL "CREADSTREAM" USING TERMINALID OFFSET MAXINBUFLEN INBUF ACTINBUFLEN RESULT. (on MPE V and in compatibility mode on MPE XL) CALL INTRINSIC "READSTREAM" USING TERMINALID OFFSET MAXINBUFLEN INBUF ACTINBUFLEN RESULT. (in native mode on MPE XL) All parameters are numeric data items except INBUF, which is an alphanumeric data item. CALL READSTREAM (TERMINALID, OFFSET, MAXINBUFLEN, INBUF, ACTINBUFLEN, RESULT) All parameters are integer variables except INBUF, which is a character array. CALL BREADSTREAM (T, O1, L7, I$, L8, R) (on MPE V and in compatibility mode on MPE XL) CALL READSTREAM (T, O1, L7, I$, L8, R) (in native mode on MPE XL) All parameters are integer variables except I$, which is a string variable.
READSTREAM (TERMINALID, OFFSET, MAXINBUFLEN, INBUF, ACTINBUFLEN, RESULT) All parameters are integer data items except INBUF, which is a byte array. READSTREAM (TERMINALID, OFFSET, MAXINBUFLEN, INBUF, ACTINBUFLEN, RESULT); All parameters are short integers except for INBUF, which is a packed array of char. READSTREAM (&TERMINALID, &OFFSET, &MAXINBUFLEN, INBUF, &ACTINBUFLEN, &RESULT); All parameters are of type short, except INBUF, which is a character array (a pointer to a char). Following are excerpts from a Pascal program that calls SNA IMF intrinsics. For examples of complete Pascal programs in non-transparent and transparent modes, see Appendix F “Sample Programs”
|
|