The Set_Receive_Timer (CMSRCT) call sets the timeout timer for a blocking Receive or Receive_Mapped_Data call.
When this timer is set and receive_type=CM_RECEIVE_AND_WAIT is set for receiving data, the Receive and Receive_Mapped_Data calls are aborted after the period of time defined in the receive_timer field.
Set_Receive_Timer can be called after the Allocate call at any time and as often as you like within a conversation. The timer setting of the last Set_Receive_Timer call applies in each case.
This function is not part of the CPI-C Specification, but is an additional function of the UPIC carrier system.
UPIC local on Unix, Linux and Windows systems:
Connection via UPIC local does not support the Set_Receive_Timer call.
CMSRCT (conversation_ID, receive_timer, return_code)
Parameters
--> conversation_ID | Identifier of the conversation |
--> receive_timer | Time in milliseconds after which a blocking Receive or Receive_Mapped_Data call is interrupted. The Receive and Receive_Mapped_Data calls have a blocking effect when the receive_typecharacteristic has the value CM_RECEIVE_AND_WAIT. The receive timer is reset when you set receive_timer to 0. The wait time of the Receive or Receive_Mapped_Data call is then no longer monitored. The value specified for receive_timer is rounded up to the next full second. |
<-- return_code | Result of the function call. |
Result (return_code)
CM_OK
The call is OK.
CM_PROGRAM_STATE_CHECK
The conversation is not in the “Send” or “Receive” state.
CM_PROGRAM_PARAMETER_CHECK
conversation_ID is invalid or a value < 0 was specified in receive_timer.
CM_PRODUCT_SPECIFIC_ERROR
The UPIC instance could not be found.
CM_CALL_NOT_SUPPORTED
The function is not supported.
State change
If there are no errors, this function returns the result CM_OK. This call does not change the state of the conversation.
Notes
The Set_Receive_Timer is only useful in connection with the Receive and Receive_Mapped_Data calls.
Set_Receive_Timer can be called an unlimited number of times within a conversation. The valid value is always the one which was set in the last call of Set_Receive_Timer before a Receive or Receive_Mapped_Data call. The value set remains valid until the next Set_Receive_Timer call or until the end of the conversation.
Behavior in the event of errors
CM_PROGRAM_STATE_CHECK
Modify program.
CM_PROGRAM_PARAMETER_CHECK
Modify program.
CM_PRODUCT_SPECIFIC_ERROR
The operating system cannot provide sufficient memory for the internal buffers. Check whether the memory requirements of your program are too high and if necessary reboot your system.
CM_CALL_NOT_SUPPORTED
This return code only applies to Unix, Linux and Windows systems.
This is not necessarily an error: If the application is intended for both UPIC-L and UPIC-R this return code just means that the application is linked to a UPIC-L library. The program can take note of this return code and avoid making further Set_Receive_Timer calls.
CM_ENTRY Set_Receive_Timer ( unsigned char CM_PTR conversation_ID, CM_TIMEOUT CM_PTR timeout_time, CM_RETURN_CODE CM_PTR return_code )