DCE Application Programming Guide
Sample Mixed-Language Application
HP NonStop DCE Application Programming Guide—429551-003
B-3
The Server File
#define Max_Concurrent_Calls 10
/* Prototype for Cobol routine. */
_cobol void COBOLADDONE (extptr unsigned long *iterations,
extptr unsigned long *buflen,
extptr unsigned char *buffer);
/* ******* Server Control ******/
main()
{
error_status_t status;
/* Register interface */
rpc_server_register_if (turnaround_v1_0_s_ifspec,
NULL,
NULL,
&status);
ERR_CHK(status, “Could not register interface.”);
/* Use all protocol sequences */
rpc_server_use_all_protseqs_if (Max_Concurrent_Calls,
turnaround_v1_0_s_ifspec,
&status);
ERR_CHK(status, “Could not use all protocol sequences.”);
/* Listen for service requests */
printf (“Turnaround server is now listening for calls.\n”);
rpc_server_listen (Max_Concurrent_Calls,
&status);
ERR_CHK(status, “Could not listen.”);
return 0;
}
/****** End of Server Control ******/
/********************** Server Operations***************************/
void Turnaround (unsigned long *iterations,
unsigned long buflen,
unsigned char *buffer)
{
*iterations = *iterations + 1;
}
Figure B-3. The Server File in a Mixed-Language Application (page 2 of 3)