home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / rec / games / mud / misc / 1739 < prev    next >
Encoding:
Text File  |  1992-12-27  |  1.7 KB  |  34 lines

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