Function sapnwrfc::binding::RfcStartServer [] [src]

pub unsafe extern "C" fn RfcStartServer(
    argc: c_int,
    argv: *mut *mut SAP_UC,
    connectionParams: *const RFC_CONNECTION_PARAMETER,
    paramCount: c_uint,
    errorInfo: *mut RFC_ERROR_INFO
) -> RFC_CONNECTION_HANDLE

Allows a program to be used as an RFC server which is started by the backend on demand.

This API needs to be called, if the server program is to be started by the R/3 application server. (RFC destination in SM59 of type "T" in startup mode.) argc and argv are the inputs of the mainU function. The R/3 application server passes the correct command line to the program, when starting it up, so you only need to forward these two parameters to %RfcStartServer(). connectionParams is optional and is only needed, if you want to add additional logon parameters to the ones coming from the command line, e.g for activating trace.

Like RfcRegisterServer(), the function returns a server connection handle that can be used in RfcListenAndDispatch(). The mechanism of this kind of RFC destination thus works as follows: -# The R/3 application server opens a telnet connection to the host, where your server program is located, and starts the program with the necessary logon parameters. (Or creates a child process, if the startup method is "Start on application server".) -# Your server program calls RfcStartServer, which opens an RFC connection back to the R/3 system. -# The R/3 system then makes the function call over that RFC connection.

The main differences of "startup mode" compared to the "registration mode" are: - Advantage: no logon parameters need to be maintained in the server program. (Unless you want to open an additional client connection for looking up function module metadata (RFC_FUNCTION_DESC_HANDLEs) in the R/3 DDIC.) - Disadvantage: every single function call creates a new process and a telnet connection in addition to the actual RFC connection.

\in argc From mainU() (command line supplied by backend) \in **argv From mainU() (command line supplied by backend) \in *connectionParams May optionally contain additional logon parameters \in paramCount Length of the connection parameter array above \out *errorInfo Returns more error details, if the connect attempt fails. \return A handle to an RFC server connection that can be used for listening for function module requests from the backend.