Code Examples.
More...
Code Examples.
The code for EO is generated by the IDE (refer IDE User Guide). The users might want to be cautious when using the CL_EO_USE_THREAD_FOR_APP. The application take control of the main thread and has to hold the thread through it's lifetime. If the thread is released prematurely the behavior is undefined. The only way the application can be shutdown is through the invocation of clCpmComponentTerminate() which in turn invokes the callback clCompAppTerminate(). The logic to unblock the main thread should reside in this callback just before clCpmResponse().
The appropriate callbacks are as shown below:
clCompAppInitialize(
ClUint32T argc,
ClCharT *argv[])
{
mypid = getpid();
goto errorexit;
#if HAS_EO_SERVICES
rc = clSAFComponent1EO0ClientInstall();
#endif
goto errorexit;
goto errorexit;
clprintf ("Component [%s] : PID [%d]. Initializing\n",
clprintf (" IOC Port : 0x%x\n", iocPort);
{
}
return rc;
errorexit:
clprintf ("Component [%s] : PID [%d]. Initialization error [0x%x]\n",
appName.
value, mypid, rc);
return rc;
}
clCompAppTerminate(
ClInvocationT invocation,
{
clprintf ("Component [%s] : PID [%d]. Terminating\n",
goto errorexit;
goto errorexit;
clprintf ("Component [%s] : PID [%d]. Terminated\n",
return rc;
errorexit:
clprintf ("Component [%s] : PID [%d]. Termination error [0x%x]\n",
compName->
value, mypid, rc);
return rc;
}