jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: gethostbyname () causing irritating delays


On Thu, May 02, 2002 at 11:50:08AM -0400, John E. Davis wrote:
> Ethan Blanton <eblanton@xxxxxxxxxxxx> wrote:
> >My jed is doing a hostname lookup at startup (and has for several
> >versions now, I'm not sure how many) that causes irritating delays
> >when I am on a slow link or temporarily disconnected (temporary
> >disconnection is a likely time to want to be fixing things fast in
> >your editor!) from the network.  I think this is happening in
> >get_hostname () from userinfo.c.  My question is this...  Why are we
> >doing this now, and should it be default?
> 
> It uses the hostname information for locking files, etc.  This is
> particularly useful when on a network.

Ah, so this is a useful reason to have that information, and one I can
accept.

> I think that if you are experiencing delays, then your /etc/hosts file
> is probably faulty.  Make sure the first line looks like

I realize that it is due to my hostname not being in /etc/hosts; I am
currently solving this problem by hardcoding my hostname to a bogus
example.org address and putting that hostname in /etc/hosts.  The setup in
question, however, is on a laptop that often roams networks and should (in
order for everything to work "properly") be getting its current hostname
from, e.g. DHCP.  If I roam to a network and get a valid hostname via DHCP
and then, say, the router goes down, I get these delays.

Granted, I could put all of those hostnames in /etc/hosts as I get them, but
I am often on networks with hostnames I cannot expect ahead of time, and
this is somewhat irritating.

My gut feeling is that the Right Solution is for gethostname () to return
the correct value (i.e. hostname should be used to set the FQDN), rather
than depending on a gethostbyname () for said lookup.  That said, it ain't
my editor.  ;-)
Ethan

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]