[#3006] CVS repository — "Eugene Scripnik" <hoaz@...>

Hello.

21 messages 2004/06/16
[#3008] Re: CVS repository — ts <decoux@...> 2004/06/16

>>>>> "E" == Eugene Scripnik <hoaz@gala.net> writes:

[#3009] Re: CVS repository — Michal Rokos <michal@...> 2004/06/16

Hi!

[#3057] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

Hi,

20 messages 2004/06/23

More networking issues

From: Dave Thomas <dave@...>
Date: 2004-06-23 14:30:23 UTC
List: ruby-core #3053
I'm trying to understand the changes to Socket.gethostbyname/addr

In 1.6, gethostbyname returned (for IPv4) the 4 byte address of the 
given host. In Ruby 1.9, it returns a 16 byte structure, which I'm 
assuming is a sockaddr_in.

First, is that correct--was there a change between 1.6 and 1.8/9 on the 
return type of gethostbyname?

If so, how do I then use gethostbyaddr? It seems wrong to say

         require 'socket'
         a = Socket.gethostbyname("161.58.146.238")
         res = Socket.gethostbyaddr(a[3][4..7], a[2])

Shouldn't the two be compatible?


Cheers

Dave


In This Thread

Prev Next