[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV Making lynx more portable and reliable
From: |
John E. Davis |
Subject: |
Re: LYNX-DEV Making lynx more portable and reliable |
Date: |
Thu, 23 Oct 1997 00:44:52 -0400 |
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.
--John
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;