Use
SAPCMTIMEOUT controls the behaviour of the "blocking" CPI-C functions.
Blocking CPI-C functions are functions, which normally only return to the caller if the return code was sent by the SAP Gateway.
This can sometimes take a long time. In environments such as WINDOWS, this would cause the whole PC to be blocked. You can use SAP_CMTIMEOUT to specify a time in milliseconds, after which the function returns. If a timeout is set, CM_SAP_TIMEOUT_RETRY is returned as a return code. The function must then be called again (see also function
SAP_CMHANDLE).
CM_RETCODE return_code;
CPIC_INT timeout;
..
timeout = 10;
SAP_CMTIMEOUT(timeout, &return_code);
..
Possible values for timeout:
No timeout
CPI-C functions wait "indefinitely" for the return code (default setting)
Timeout in milliseconds; The value zero caused an immediate timeout.