Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: iglesias@draco.acs.uci.edu (Mike Iglesias)
Subject: Re: gethostbyaddr() doesn't find host (Digital Unix V3.2c)
Date: 1996/03/14	[thread overview]
Message-ID: <4i9m7l$itb@news.service.uci.edu> (raw)
In-Reply-To: 826554688.24324.0@fersys.demon.co.uk

In article <826554688.24324.0@fersys.demon.co.uk>,
 <mlb@fersys.demon.co.uk> wrote:
>I am accepting a socket connection, and trying to ascertain the hostname 
>of the source.  I'm calling inet_ntoa() on the network address
>[ inetaddr = inet_ntoa (acc_addr.sin_addr); ]
>and then passing the resulting string to gethostbyaddr(), but
>the system does not find my host, even though it's in the host file.

You're misinterpreting the man page for gethostbyaddr().  You want to
pass acc_addr.sin_addr to it rather than the ASCII representation of
the IP address.


-- 
Mike Iglesias                        Internet:    iglesias@draco.acs.uci.edu
University of California, Irvine     phone:       (714) 824-6926
Office of Academic Computing         FAX:         (714) 824-2069




  parent reply	other threads:[~1996-03-14  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <826554688.24324.0@fersys.demon.co.uk>
1996-03-13  5:00 ` gethostbyaddr() doesn't find host (Digital Unix V3.2c) John Sanders
1996-03-14  5:00 ` Mike Iglesias [this message]
1996-03-20  5:00 ` Dave Munro
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox