HPlogo LU 6.2 API Application Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5  Intrinsic Descriptions

MCRcvNoWait

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Receives any information available for the specified conversation but does not wait for information to arrive before returning control to the calling TP.

Syntax

			              I16V        I16             I16
									MCRcvNoWait(ResourceID, Length, RequestToSendReceived,
 
 					            CA       I16        I32
 							           Data, WhatReceived, Status);

Parameters

ResourceID

Required; 16-bit signed integer by value; input. This is the unique resource ID number assigned to this conversation when it was allocated. See MCAllocate or MCGetAllocate, in this chapter, for more information.

Length

Required; 16-bit signed integer by value; input/output.

Input:

The Length value that the local TP passes to the remote TP indicates the maximum amount of data, in bytes, that the local TP can receive in its Data parameter. The Length value must not exceed 4092 bytes. A Length of 0 means that only control or error information can be received (no data).

Output:

If data is received (WhatReceived = DATA_COMPLETE or DATA_INCOMPLETE), the Length value that the remote TP returns to the local TP is the actual length of the data received. If control information is received (WhatReceived = SEND, CONFIRM, CONFIRM_SEND, or CONFIRM_DEALLOCATE), the remote TP does not change the value in the Length parameter, so it contains whatever was supplied as input.

RequestToSendReceived

Required; 16-bit signed integer; output. Indicates whether the remote TP has issued a RequestToSend. Possible values are as follows:

1 = YES

Indicates a RequestToSend has been received from the remote TP. The remote TP has issued the equivalent of the MCReqToSend intrinsic, requesting that the local TP enter Receive state and place the remote TP in Send state.

0 = NO

No RequestToSend has been received.

Data

Required; character array; output; EBCDIC. The character array into which the local TP will receive data sent by the remote TP. The length of the Data array must be greater than or equal to the value in the Length parameter.

If the data comes from an EBCDIC application, the local TP must convert it from EBCDIC to ASCII. The MPE CTRANSLATE intrinsic, or the NLTRANSLATE intrinsic on MPE XL, may be used.

WhatReceived

Required; 16-bit signed integer; output. If the value returned in the Status parameter is 0, then the WhatReceived parameter contains a value indicating the type of information received. Possible values are as follows:

1 = DATA_COMPLETE

Indicates that a complete data record, or the final portion of a data record, has been received. The Length parameter determines the amount of data that can be received in a single call to MCRcvAndWait. If a data record is larger than the value in the Length parameter, you must call MCRcvAndWait more than once to receive a complete record.

2 = DATA_INCOMPLETE

Indicates that less than a complete record has been received, and you must call MCRcvAndWait again to receive the next portion of it. Incomplete data records are received when the size of a record exceeds the value in the Length parameter. When the final portion of a data record is received, the WhatReceived parameter returns 1 (DATA_COMPLETE).

4 = SEND

Indicates that the remote TP has issued the equivalent of MCPrepToRcv or MCRcvAndWait and has entered Receive state. The local TP is now in Send state and can issue only those intrinsics that are callable from Send state.

5 = CONFIRM

Indicates that the remote TP has issued the equivalent of MCConfirm, placing the local TP in Confirm state. Unless it detects an error, the local TP must respond with a call to MCConfirmed.

6 = CONFIRM_SEND

Indicates that the remote TP has issued the equivalent of MCPrepToRcv with a synchronization level of CONFIRM. The local TP is placed in Confirm Send state. Unless it detects an error, it must send a confirmation response to the remote and enter Send state.

7 = CONFIRM_DEALLOCATE

Indicates that the remote TP has issued the equivalent of MCDeallocate with a synchronization level of CONFIRM. The local TP is placed in Confirm Deallocate state. Unless it detects an error, it must send a confirmation response to the remote TP and call MCDeallocate with a DeallocateType of LOCAL. When the remote TP deallocates normally, a status info value of +100 is returned to the local TP.

Status

Required; 32-bit signed integer; output. Indicates the result of intrinsic execution. See the "Status Parameter" section, earlier in this chapter, for more information.

Description

The MCRcvNoWait intrinsic receives any data that has arrived in the receive buffer for the specified conversation. It differs from the MCRcvAndWait intrinsic in the following ways:

  1. MCRcvNoWait can be called only from Receive state. Unlike MCRcvAndWait, it cannot be used to change the conversation state of the local TP from Send state to Receive state.

  2. Unlike MCRcvAndWait, which waits for information from the remote before returning control to the calling TP, MCRcvNoWait does not wait for information to arrive. It checks to see if any information is available in the receive buffer, and if the buffer is empty, it returns a status info value of +38 ( Not Posted) and returns control to the TP.

  3. The MCRcvNoWait intrinsic can receive a maximum of 4092 bytes in a single intrinsic call. The MCRcvAndWait intrinsic can receive 4092 bytes on MPE V, or 32763 bytes on MPE XL, in a single intrinsic call.

MCRcvNoWait may not be used in conjunction with posting. Posting ends as soon as MCRcvNoWait is called. For more information on posting, see the description of MCPostOnRcpt, earlier in this chapter.

When logical records sent by the remote processor are larger than 4092 bytes, the local TP must call MCRcvNoWait more than once to receive each record.

NOTE: If the local TP will be receiving data records larger than 4092 bytes, it must allocate more than one location for storing data. Data received in the Data parameter during the first call to MCRcvNoWait will be overwritten during the second call unless it is moved to another location.

Status Info Values

 0    Successful Completion.
-1    Intrinsic called with parameter out of bounds.
-2    Invalid 'ResourceID' parameter specified in intrinsic call.
-11   Out of range 'Length' parameter specified in intrinsic call.
-13   Data buffer specified in intrinsic call is out of bounds.
-20   Not enough stack space for intrinsic to run.
+38   Not Posted.
-40   Intrinsic called in invalid state.
-50   Allocation Error.
-51   Resource Failure:  Retry possible.
-52   Resource Failure:  No retry possible.
-56   Program Error:  No data truncation has occurred.
-60   Program Error:  Data may have been purged.
-90   An internal error in Presentation Services has occurred.
-91   An internal error in the APPC subsystem has occurred.
+100  Deallocate Normal received from the remote TP.
-1002 An internal error at the mapped conversation level has occurred.
-1003 Required parameter missing.
-1020 Deallocate Abend.
-1050 Invalid 'Data' parameter specified in intrinsic call.
-1105 Internal Error: Conversation deallocated.
Feedback to webmaster