OpenTP1 Version 7 Programming Reference C Language
dc_rpc_set_service_prio - Set a schedule priority of a service request
Format
ANSI C, C++
#include <dcrpc.h> void dc_rpc_set_service_prio (DCLONG prio) |
K&R C
#include <dcrpc.h> void dc_rpc_set_service_prio (prio) DCLONG prio; |
Description
The function dc_rpc_set_service_prio() sets a priority of a service request. It is called when controlling schedule priorities for individual service requests. The priority set by this function remains unchanged until it is updated by the same function. Therefore, if service requests are to be called at once with the same priority, call this function only once.
The priority set by this function will be reported to the server via the schedule queue by the function dc_rpc_call() which is called immediately after this function.
If this function is not called at all, the value 4, which is the default interpretation of the schedule service, is set as the priority of service requests.
Arguments whose value is set in the UAP
prio
Specify the schedule priority of the service request in the range from 0 to 8. This argument must always be set.
The highest priority is represented by 1 and the lowest priority is represented by 8. If 0 is specified, the default interpretation of the schedule service will be in effect.
If a value other than the above is specified, the function dc_rpc_set_service_prio() is ignored.
Return values
There is no return value of the function dc_rpc_set_service_prio().
Notes
Example
int rc; DCULONG in_len, len; char *buf; /* First service request: * No priority is set (default interpretation of schedule service in effect) */ rc = dc_rpc_call("SPPG", "ECHO", "exl", &in_len, buf, &len, DCNOFLAGS); /* Second service request: Priority = 8 */ dc_rpc_set_service_prio(8); rc = dc_rpc_call("SPPG", "ECHO", "ex2", &in_len, buf, &len, DCNOFLAGS); /* Third service request (chained RPC): Priority = 1 */ dc_rpc_set_service_prio(1); rc = dc_rpc_call("SPPG", "ECHO", "ex3", &in_len, buf, &len, DCRPC_CHINED); : (Chained RPC dc_rpc_call(DCRPC_CHAINED) repeated n times) : rc = dc_rpc_call("SPPG", "ECHO", "ex3", &in_len, buf, &len, DCNOFLAGS); /* (4 + n + 1)-th or subsequent service request: * Priority is reset (to default interpretation of schedule service) */ dc_rpc_set_service_prio(0); rc = dc_rpc_call("SPPG", "ECHO", "ex4", &in_len, buf, &len, DCRPC_NOREPLY); |
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.