[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV Making lynx more portable and reliable
From: |
Klaus Weide |
Subject: |
Re: LYNX-DEV Making lynx more portable and reliable |
Date: |
Thu, 23 Oct 1997 13:20:52 -0500 (CDT) |
On Thu, 23 Oct 1997, John E. Davis wrote:
> On Thu, 23 Oct 1997 03:35:51 GMT, Victor Schneider <address@hidden> said:
> >What I'm going to suggest is an idea that makes the slrn news reader more
> >reliable: Instead of calling `gethostbyname' and taking what it returns,
> >set up a loop to call gethostbyname several times until it either times out
> >or returns something. It seems that not all internet providers and not all
> >wsock32.dll's are created equal.
>
> He is referring to the following that I use for slrn:
>
> host_entry = NULL;
> if (-1 != gethostname (host, MAX_HOST_NAME_LEN))
> host_entry = gethostbyname (host);
> #if defined(TRY_AGAIN) && !defined(MULTINET)
> if ((host_entry == NULL) && (h_errno == TRY_AGAIN))
> {
> sleep (2);
> host_entry = gethostbyname (host);
> }
> #endif
>
> Basically, gethostbyname could return prematurely and set h_error to
> TRY_AGAIN. The man page suggests that this is a temporary failure and
> that you should try the call again later, so I have it sleep for two
> seconds and try it one more time.
Is h_errno defined on all platforms (except with MULTINET) that have
a gethostbyname()? Should this be added generally or just for some
platforms? (It seems that it is not needed in general for Unix etc.,
otherwise there would be more lookup failures.)
Klaus
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;