home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: rec.games.mud.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!purdue!mentor.cc.purdue.edu!scg
- From: scg@mentor.cc.purdue.edu (Kelly Martin)
- Subject: Re: Note to any fellow DikuMUD coders...
- In-Reply-To: gordon@meiko.com's message of Fri, 25 Dec 1992 19:24:50 GMT
- Message-ID: <SCG.92Dec27225529@mentor.cc.purdue.edu>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Reply-To: scg@mentor.cc.purdue.edu
- Organization: Gender Anarchists United
- References: <3331@bsu-cs.bsu.edu> <1992Dec24.114107.18992@meiko.com>
- <jck1H8e5mb@atlantis.psu.edu> <1992Dec25.192450.3167@meiko.com>
- Date: Mon, 28 Dec 1992 03:55:29 GMT
- Lines: 19
-
- gordon@meiko.com (Gordon Henderson) writes:
-
- >Well, I'm no expert, but doesn't inet_ntoa() need a struct in_addr as
- >it's parameter whereas getpeername() and accept() return you a struct
- >sockaddr, and I guess i'd have to do some bit-twidling to convert one
- >to the other (unless, of course there is another function to do it
- >for me), or am I just missing something fundamental?
-
- a struct sockaddr_in contains a struct in_addr. accept provides a
- struct sockaddr, which is the "superclass" for the various sockaddr
- types (there's also sockaddr_un, and may be others for other domains
- which may exist in your operating system). a cast should suffice,
- followed by the appropriate structure element reference (a sockaddr_in
- has a port number in it as well as a struct in_addr).
- --
- You see, if God (tm) is on the wrong side, then He (tm) is not TheOneTrueGod
- (tm), and is thus revealed, discredited, and sued for trademark infringement.
- Thus one can identify all false gods by applying this simple test of whether or
- not they agree with you or not. -- Brian Kauffman (kauff@neit.cgd.ucar.edu)
-