OpenTP1 Version 7 Programming Reference C Language

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

Create a service function (MHP)

Format

ANSI C, C++

void function-name (void)
{
Service processing
}

K&R C

void function-name ()
{
Service processing
}

Description

The MHP service function executes a service and returns the execution results. When the MCF receives a message, the MHP having the service function that corresponds to the application name is started.

Create the MHP service function in the above format as required. The service function name corresponds to the entry point name of the service function. Specify this correspondence in the user service definition of the process that executes the service function.

The correspondence between the service name and the application name is specified in the MCF application definition.

Argument

None

Notes on service function processing

  1. The following functions cannot be called from the service function:

dc_rpc_open()

dc_rpc_close()

dc_mcf_open()

dc_mcf_close()

dc_rpc_mainloop()

dc_mcf_mainloop()

Also, do not use exit() in the service function. The UAP operation is not ensured if any of the functions or exit() is used

  1. After system calls such as fork(), exec(), and system() are called to create a child process, all the OpenTP1 functions cannot be called from the child process.
  2. Another UAP cannot use a service request to the MHP service function by using the function dc_rpc_call().

Return value

No return value. Specifying -1 as a return value does not request rollback processing.