Function sapnwrfc::binding::RfcGetConnectionAttributes [] [src]

pub unsafe extern "C" fn RfcGetConnectionAttributes(
    rfcHandle: RFC_CONNECTION_HANDLE,
    attr: *mut RFC_ATTRIBUTES,
    errorInfo: *mut RFC_ERROR_INFO
) -> RFC_RC
[]

Returns details about the current client or server connection.

Consider that in case you are a server and call RfcListenAndDispatch(), the partner fields of the attributes will be cleared. The reason is, although we might be only connected to a gateway of one application server, the function module can be also called from the other application servers of the system if configured accordingly in the SM59 destination.

I.e. expect only valid partner information from within a function module. Outside of the function module, e.g. in the loop where RfcListenAndDispatch is called, you will get cleared partner information in most of the cases except case RFC_OK, which means that you were just called by an application server.

See documentation of RFC_ATTRIBUTES.

\in rfcHandle RFC connection \out *attr Information about the current connection and the communication partner on the other side. \out *errorInfo Additional error information (e.g. connection already closed). \return RFC_RC