chemcop_ping.pl
{
/* ____________________________________________________________________________
Copyright (C) DataAspects, Inc. 1998
chemcop_ping.pl
Objective: Determine if the client can call server chemcop.pl,
a remote procedure.
Actions:
1. Client chemcop_ping.pl connects to chemcop.pl, a TRIMrpc program
running on the Daylight server, & passes it two parameters:
parm.0 'db_exec' - orders chemcop to run a command procedure
parm.1 'chemcop_ping' -name of chemcop block that writes
a 'hello' message to /usr1/trim/run/chemcop.log
on the Daylight server.
2. Chemcop.pl returns false if the 'chemcop_ping' procedure was run,
else true is returned.
Compile: trimgen chemcop_ping.pl -a
Run: trimrun chemcop_ping
...Pat McGreevy, 18 Feb 99
_____________________________________________________________________________ */
char chemserver[20];
int rc;
list temp_list;
chemserver= "xxx.xxx.xx.xx";
printf("Wait...Connecting to Chemcop on ChemServer");
if (trap({
connect(0,"net:chemcop@"^^chemserver^^"!vtxhost.trm");
printf(" Connected to Chemcop");
})){
bell();
printf(" Failed to connect to Chemcop");
connect(0);
break;
}
rc= (exec_sql("chemcop_ping")); /* TRIMrpc-remote procedure call */
printf("return code= "^^rc);
if (rc == 0)
printf("Hello from chemcop running on the Daylight server");
else
printf("Failed to run 'chemcop_ping' procedure on Daylight server");
}