From: CarlosRivera Date: 2004-10-04T05:19:55+09:00 Subject: Re: Socket::gethostbyname() 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 > >