× 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 a Socket Server application written in RPGLE with accepts Client
socket connections from a Dec Alpha Server. (It is based heavily on
Scott Klement's excellent Sockets Tutorial.) We want to close down the
Socket Server program in order to do tape backups over night.

The RPG Socket Server either sits indefinitely on an Accept() statement
(if a client has not connected), or on a rdLine() statement if a client
has connected but is waiting for some more data to be sent.

How can I make the socket server drop back into the rpg in order to test
is a shutdown has been requested... by shutdown I mean setting a value
in a dataarea or something, rather than just ENDJOB *immed. I don't
think we have the option of changing the client software which was
written in Pascal a long time ago.

C* Tell socket to linger for 30 seconds
C Eval linglen=%size(linger)
C alloc linglen ling
C Eval p_linger=ling
C Eval l_onoff=1
C Eval l_linger=30
C CallP setSockOpt(csock:SOL_SOCKET:SO_LINGER:
C ling:linglen)
* If we didn't receive anything, delay for 30 secs
C Eval lenSent=RdLine(csock:%addr(line):
C msgLen:*On)
C Select
....

Should the RdLine drop through to Select after 30 seconds if not data is
received ?

Thanks in advance

Andy Thompson
Yearsley Group


CONFIDENTIALITY NOTICE : This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under law. If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you received this in error, please contact the sender and delete the material from any computer.

We have taken precautions to minimise the risk of transmitting software viruses, however, you need to carry out your own virus checks on any attachments as we can take no responsibility for any computer virus transferred by way of this email.

All views or opinions expressed will be those of the author and not necessarily those of Harry Yearsley Ltd.

Business is conducted as under our Terms and Conditions available on request.

Harry Yearsley Ltd, Registered 556895 & Yearsley CS Ltd 5747265

Registered Office : Yearsley Group, Hareshill Road, Heywood, Lancs., OL10 2TP

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.