Xref: utzoo comp.sys.encore:608 comp.unix.questions:21949 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!stealth.acf.nyu.edu!brnstnd From: brnstnd@stealth.acf.nyu.edu Newsgroups: comp.sys.encore,comp.unix.questions Subject: Re: getsockname problem ?? Message-ID: <20328:May402:03:4790@stealth.acf.nyu.edu> Date: 4 May 90 02:03:47 GMT References: <7889@rouge.usl.edu> <1990May3.233332.5956@athena.mit.edu> Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 14 A note of warning: In a struct servent (as read from /etc/services), s_port is defined as an int. Don't pass it to ntohl()! All ports are unsigned short values and should go through ntohs(). In article <1990May3.233332.5956@athena.mit.edu> jik@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. ---Dan