https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzab6/csignals.htm I was thinking along these lines.
Sent from Mail<
https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Paul Roy<mailto:Paul.Roy@xxxxxx>
Sent: Thursday, January 30, 2020 3:34 PM
To: Bare Metal Programming IBM i (AS/400 and iSeries)<mailto:c400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: [C400-L] How to properly end a C program using stdio with F3
I have written socket server programs and they generally are waiting client connections in sleep mode on a listen() instruction using blocking sockets...
So the server programs that I have implemented can receive commands (like a *STOP message) directly as data received on the socket and terminate properly ...
The other way to stop them is to issue an ENDJOB command from another job or an ENDRQS in the same job (SysReq ... 2) ...
Implementing a solution with data queues would IMHO require to implement non-blocking sockets... but I have no successful experience with that (too much CPU consumed... )
I remember using user defined communication API for use in an X25 server program but that was 30+ years ago .. they worked with dataqueues but (if I remember correctly) they work at the physical interface level... So I suspect you would need a dedicated ethernet line for you program to implement this technique
Paul
________________________________
From: C400-L <c400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Patrik Schindler <poc@xxxxxxxxxx>
Sent: Thursday, January 30, 2020 4:36 PM
To: Bare Metal Programming IBM i (AS/400 and iSeries) <c400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: [C400-L] How to properly end a C program using stdio with F3
Hello Ron,
Am 30.01.2020 um 14:00 schrieb Ron Unknown <qgenesist@xxxxxxxxxxx>:
additionally, if its a must run singleton, you can aloc the dataq in the run up to your program and when you send any start command, if the dataq is aloc excl then you can run, if you cant get the lock its already running.
Very nice proposal for a poor man's lockfile! Thanks!
:wq! PoC
PGP-Key: DDD3 4ABF 6413 38DE -
https://www.pocnet.net/poc-key.asc
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/c400-l.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://amazon.midrange.com
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/c400-l.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.