RFC_RC  SAP_API   RfcWaitForRequest(RFC_HANDLE    handle,
  RFC_INT   wtime);

Using the registering feature of an SAP system onwards, an RFC server program can issue RfcAccept to register itself at an SAP gateway. After that, it can wait for any RFC request by issueing RfcGetName, RfcDispatch or RfcListen.

RfcGetName and RfcDispatch are blocking calls. The server has to wait until any RFC request is incoming.

In SAP system RfcListen is a non-blocking call. However, if you do not issue the RfcListen call quick enough, the SAP gateway will return an error to the RFC client, because no server program was available at that time.

Instead of RfcListen, you can use this new call RfcWaitForRequest with a time interval in seconds as a parameter to define how long you want to wait for RFC requests.

This function is defined in SAPRFC.H.

Function Parameters:

·        handle

RFC connection handle

·        wtime

Wait time

This call is available with the RFC library.

For more details, see saprfc.h, srfcserv.c or saprfc.hlp in the delivered RFC SDK.