Function sapnwrfc::binding::RfcListenAndDispatch [] [src]

pub unsafe extern "C" fn RfcListenAndDispatch(
    rfcHandle: RFC_CONNECTION_HANDLE,
    timeout: c_int,
    errorInfo: *mut RFC_ERROR_INFO
) -> RFC_RC

Listens on a server connection handle and waits for incoming RFC calls from the R/3 system.

The mechanism for dispatching incoming function calls works as follows: First %RfcListenAndDispatch() checks, whether for the current combination of R/3 SystemID and function module name a callback function has been installed via RfcInstallServerFunction(). If not, it checks, whether a callback function for SystemID=NULL has been installed via RfcInstallServerFunction().If not, it checks, whether a global callback function has been installed via RfcInstallGenericServerFunction().

If a callback function has been found, the RFC call will be dispatched to that function for processing, and %RfcListenAndDispatch() returns the return code of the callback function. Otherwise %RfcListenAndDispatch() returns a SYSTEM_FAILURE to the R/3 backend and the return code RFC_NOT_FOUND to the caller.

In general the return codes of %RfcListenAndDispatch() have the following meaning: - RFC_OK\n A function call was processed successfully. - RFC_RETRY\n No function call came in within the specified timeout period. ("timeout" is given in seconds.) - RFC_ABAP_EXCEPTION\n A function call was processed and ended with a defined ABAP Exception, which has been returned to the backend.

In the above three cases "rfcHandle" is still open and can be used to listen for the next request.

In these five cases the connection has been closed, so the "rfcHandle" needs to be refreshed via RfcRegisterServer.

\in rfcHandle Server connection on which to listen for incoming requests. \in timeout Number of seconds to wait for an incoming request. \out *errorInfo Additional error information. \return RFC_RC