× 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.


  • Subject: Re: TCP/IP Sockets
  • From: "Bob Crothers" <bob@xxxxxxxxxxxxxx>
  • Date: Fri, 11 Jun 1999 18:50:32 -0500

David,

Close, but not quite.  the read() will return a -1 to indicate an
error.  At that point, the errno variable (defined in C header file
errno.h).  Retrieving this value is very easy in ILE/C.  I don't know
how to get it with RPG.  But I could create a tiny service pgm to
retrieve it if you would like and nobody comes up with a better way.

Also note that it depends on how the socket on the other end is closed.
If a close() is issued, then you will get the -1.  But, if the other
side ends without actually closing the socket (eg: ctl-alt-del on
windows), you might not get any indication of a problem.  The
SO_KEEPALIVE socket option is SUPPOSED to handle this situation, but I
have never gotten it to work on the AS/400 (at least not up to V3R7).

Bob

-----Original Message-----
From: David Gibbs <David.Gibbs@IL.US.MKS.com>
To: 'Midrange Mailing List' <MIDRANGE-L@midrange.com>
Date: Friday, June 11, 1999 4:10 PM
Subject: RE: TCP/IP Sockets


>Folks:
>
>I'm not 100% sure on this... but I think that, when the remote site of
a
>TCP/IP connection disconnects abnormally, a read() (on the other side)
will
>return zero.
>
>david
>+---
>| This is the Midrange System Mailing List!
>| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
>| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
>| To unsubscribe from this list send email to
MIDRANGE-L-UNSUB@midrange.com.
>| Questions should be directed to the list owner/operator:
david@midrange.com
>+---
>

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.