Listen 

Purpose

Check whether an RFC request is available.

Syntax

RFC_RC Listen (void);

Return Value

An RFC_RC code indicating the status: RFC_OK, if there is an RFC event pending (call or return), RFC_RETRY, if nothing has arrived yet, or RFC_FAILURE, if an error has occurred or the server process is completed.

Description

For an RFC client program, if one does not always want to wait for the answer to an RFC call by using the Receive member function of CRfcClientFunc, one has to call the function Listen to listen for incoming RFC events. The function always returns immediately. If Listen returns RFC_OK, Receive has to be called to handle the event. It only is possible to listen for one incoming RFC message at a time.

For an RFC server program, it is also possible to use Listen while waiting for a new RFC request by Dispatch with or without register mode (see CRfcConnection::Accept). The CRfcServerApp’s Run member function already encapsulates this process.