getsockname problem ??

Jonathan I. Kamens jik at athena.mit.edu
Fri May 4 11:42:28 AEST 1990


In article <20328:May402:03:4790 at stealth.acf.nyu.edu>, 
brnstnd at stealth.acf.nyu.edu writes:
|> In article <1990May3.233332.5956 at athena.mit.edu> jik at athena.mit.edu
|> (Jonathan I. Kamens) writes:
|> > (or store a constant address into
|> > the sin_addr.s_addr field, although this type of thing is frowned upon,
|> > since you should use gethostbyname() and then assign the return value
|> > directly into the sin_addr.s_addr field),
|> Don't be so pedantic. All programs should accept both numeric addresses
|> and domain names.

  Definitely.  You're misreading what I said.  If a program is given a
numeric address, then it uses inet_addr() (which is, IMHO, in the same
class as gethostbyname().  I meant to say "something like
gethostbyname()" in my message, not just "gethostbyname()", and perhaps
that's why you misunderstood me) to convert it into a network byte
order, and then assings that to the sin_addr.s_addr field.

  When I said "constant address", I was talking about unsigned long
integers hard-coded into a program.  This is the "type of thing" I
consider to be "frowned upon."

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list