From: Markus Date: 2004-10-04T08:25:01+09:00 Subject: Re: Socket::gethostbyname() I would guess that it is a wrapper around the system's gethostbyname (especially since you have to unpack it) so "man gethostbyname" might give you some hints. Note: this is only a guess. If you want an authoritative answer (and no one else here provides it) I'd suggest checking the source code. It seldom lies, though it is at times coy about divulging its secrets. (To its credit though, I have found it to be as patient with me as I am with it. Oh my stars! It's the weekend and I'm channeling Why!) -- MarkusQ On Sun, 2004-10-03 at 13:19, CarlosRivera wrote: > I never would have guessed to have unpacked. Is there a good > explanation of this somewhere? Also, during the unpack, what is the > first element supposed to represent? > > For a reference, I am reading the Socket class at: > > http://www.ruby-doc.org/stdlib/ > > However, there seems to be no documentation on the method return types. > Is something wrong with my browser? I can see detailed information > about Net::HTTP.get(). > > ts wrote: > >>>>>>"C" == CarlosRivera writes: > > > > > > C> [~]host www.ebay.com > > C> www.ebay.com is an alias for pages.ebay.com. > > C> pages.ebay.com has address 66.135.208.101 > > C> pages.ebay.com has address 66.135.192.87 > > C> pages.ebay.com has address 66.135.192.88 > > C> pages.ebay.com has address 66.135.208.88 > > C> [~] > > > > svg% ruby -rsocket > > Socket::gethostbyname("www.ebay.com")[3..-1].each do |ali| > > p Socket.unpack_sockaddr_in(ali) > > end > > ^D > > [0, "66.135.192.87"] > > [0, "66.135.192.88"] > > [0, "66.135.208.88"] > > [0, "66.135.208.101"] > > svg% > > > > > > Guy Decoux > > > >