#include <stdio.h>#include "idl_export.h"#include "idl_request.h"#include "grpc.h"
Go to the source code of this file.
Functions | |
| IDL_VPTR | gs_cancel (int argc, IDL_VPTR *argv_idl) |
| IDL_VPTR gs_cancel | ( | int | argc, | |
| IDL_VPTR * | argv_idl | |||
| ) |
The implementation of the gs_cancel() call. This cancels a previously submitted non-blocking request.
This is part of the IDL Client for GridSolve. GridRPC cancel call
| argc | -- the number of arguments | |
| argv_idl | -- the array of IDL arguments passed in this should contain one argument: the request ID of the job to cancel. |
Definition at line 29 of file gs_cancel.c.
{
grpc_error_t ret;
int req_id;
IDL_ENSURE_SCALAR(argv_idl[0]);
req_id = IDL_LongScalar(argv_idl[0]);
/* Initialize GridRPC system */
ret = grpc_initialize(NULL);
if((ret != GRPC_NO_ERROR) && (ret != GRPC_ALREADY_INITIALIZED)) {
IDL_Message(IDL_M_GENERIC, IDL_MSG_INFO, "Error: cannot initialize!");
return IDL_GettmpLong(ret);
}
IDL_TimerBlock(IDL_TRUE);
ret = (int) grpc_cancel((grpc_sessionid_t) req_id);
IDL_TimerBlock(IDL_FALSE);
if(ret == GRPC_NO_ERROR)
del_req(req_id);
return IDL_GettmpLong(ret);
}

1.6.3-20100507