DCE Application Programming Guide

Sample Mixed-Language Application
HP NonStop DCE Application Programming Guide429551-003
B-6
The Client File
if( !(pszProtocolSequence = getenv(“PROTSEQ”)) )
{
ERROR(“Protocol sequence of server not set.”);
}
if( !(pszNetworkAddress = getenv(“IPADDRESS”)) )
{
ERROR(“IPADDRESS of server not set.”);
/* Create the binding handle for the server. */
rpc_string_binding_compose(pszUuid,
pszProtocolSequence,
pszNetworkAddress,
pszEndpoint,
pszOptions,
&pszStringBinding,
&status);
ERR_CHK(status, “Could not compose string binding.”);
rpc_binding_from_string_binding(pszStringBinding,
&turnaround_IfHandle,
&status);
ERR_CHK(status, “Could not create binding from string binding.”);
printf(“\nStarting %d RPCs of size %d bytes.\n”,
loopCount, transferSize);
currcounter = 0;
iterations = 0;
time(&start_time);
printf(“\nStart time: %s”,ctime(&start_time));
while(currcounter++ < loopCount)
{
/* Call the appropriate turnaround service depending on service */
switch (*service)
{
case ‘T’:
{
Turnaround(&iterations,transferSize,testString);
break;
}
case ‘C’:
{
TurnaroundCobol(&iterations,transferSize,testString);
break;
}
default:
{
ERROR(“Invalid service specified.”);
}
}; /* end switch (*service) */
};
time(&end_time);
printf(“End time: %s\n”,ctime(&end_time));
Figure B-4. The Client File in a Mixed-Language Application (page 2 of 3)