× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.





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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.