|
Does anyone know if the signal API's behave differently in a pre-start job
versus an interactive job? I ask because of the problem that I am having
using the API. I adapted (stole) some code from Scott Klement's article
'Handling Errors in TCP/IP Programming' created 10/23/05. When I
created a program to test this technique, all seemed to work as I
expected. When I run the program in debug mode, I had a break point on
the For loop. When I would sit on the break of the debug for an
appropriate amount of time, the 'got_alarm' routine would execute. I would
respond to the Dsply op-code and the program would return to the for
loop and execute. If I let the loop complete and execute the return all is
good. While getting ready to call the program again, if I wait to long,
the got_alarm would execute as I expect. I actually had to kill my session
to stop the got_alarm procedure from executing. Now, when I place similar
logic in a program that is running in a pre-start job (it is actually an
SQL stored procedure call that waits on xml input and then does a bunch of
stuff and the returns), the prestart job ends once the got_alarm procedure
is executed. So are there any sort of 'signals' being thrown by pre-start
jobs. If I call the pre-start job over and over again (via Iseries
Navigator and the 'Run Sql Scripts' option) quickly, the program executes
without the alarm being processed. Once I wait over 10 seconds (my test
value) and the got_alarm executes, the pre-start job ends.
/Free
alarm(wrkwaitsec); // wrkwaitsec is a variable passed into the
program
For x = 1 to 10;
Endfor;
Return;
//______________________________________________________________________________
Begsr *Inzsr;
//______________________________________________________________________________
Init_Signals();
Endsr;
/End-free
*____________________________________________________________________
* Procedure to Initialize/Enable Signals
*____________________________________________________________________
Init_Signals B
*____________________________________________________________________
Init_Signals PI
Act Ds LikeDS(SigAction_T)
/Free
Qp0SEnableSignals();
SigEmptySet(Act.Sa_Mask);
SigAddSet(Act.Sa_Mask: SIGALRM);
Act.Sa_Handler = %Paddr(Got_Alarm);
Act.Sa_Flags = 0;
Act.Sa_SigAction = *Null;
SigAction(SIGALRM :Act :*Omit);
/End-free
P E
*______________________________________________________________________
* Procedure to Handle the Receiveing of an Alarm
*______________________________________________________________________
P Got_Alarm B
*______________________________________________________________________
D Got_Alarm PI
D wrkDspRsp S 1
/Free
Dsply ('They are here.....') ' ' wrkDspRsp;
Alarm(wrkwaitsec);
/End-free
P E
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.