OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

2.1.1 How to implement the remote procedure call

You can request an SPP service by calling the service request function from a client UAP. To request a service from a UAP, call the function dc_rpc_call() [CBLDCRPC('CALL ')] with the service group name# and service name specified as arguments. The service to be requested can be at the node of the client UAP or at a different node. There is no need for UAPs to consider whether the service to be requested is at the node of the client UAP. This is because the OpenTP1 name service is responsible for recognizing the node at which the service to be requested exists.

#
When a service group name is specified with domain qualification, a service request can also be addressed to the server UAP in the specified domain. For details on service requests with domain qualification, see 2.1.18 Service request with domain qualification.

The server UAP used by OpenTP1 is a service providing program (SPP). Client UAPs which can request SPP services are SUPs, SPPs, and MHPs.

A server UAP can be started either at the same time as OpenTP1 (automatic startup) or by executing the dcsvstart command after OpenTP1 started (manual startup). Once started, a server UAP is ready to offer service. If a service is requested to a server UAP which is not started, the function dc_rpc_call() returns with an error.

A client UAP can request service using the function dc_rpc_call() regardless of whether the process of the started server UAP is operating. Even if the process of the server UAP specified in the service request is inactive, OpenTP1 automatically starts the process.

The MHP can request services by using the RPC. However, it cannot request MHP service functions to provide services. UAP that handles offline work cannot use the RPC.

The figure below shows the server-client relationship in communication using RPC.

Figure 2-1 Client/server relationship in communication using RPC

[Figure]