Terminate(num_exitcode);
num_exitcode
Values other than 0-127 are not recommended since they may have different meanings depending on the operating system.Makes the StreamServer shutdown gracefully when all jobs being processed have been completed, including the one that called the Terminate function. Once the Terminate function has been called, no new jobs will be started. You can use the exit code to inform the application that started the StreamServer why the StreamServer has been shutdown.In UNIX bash shell scripts the exit code is stored in $? after StreamServe has exited.
Note: If several job threads call the Terminate function at the same time the exit code is undefined. When there are several calls to the Terminate function within the same job, the last call will set the exit code.
Example 92 Terminate(0);
Example 93 if ($encounteredWords="stop for two weeks")Terminate(2);else if ($encounteredWords="stop for three weeks")Terminate(3);
Example 94 In a Windows command file you can use the %ERRORLEVEL% variable with the exit code:strsc -a start.arg@echo offif %ERRORLEVEL% EQU 0 goto :ENDif %ERRORLEVEL% GEQ 4 goto :ENDgoto return%ERRORLEVEL%:return1echo The server stopped with an errorgoto :END:return2echo The server encountered the words "stop for two weeks" in
the data streamgoto :END:return3echo The server encountered the words "stop for three weeks" in
the data streamgoto :END:END
OpenText StreamServe 5.6 | Updated: 2013-03-01 |