[Win32utils-devel] ICMP pings on 1.9

Daniel Berger djberg96 at gmail.com
Mon Feb 27 16:54:48 UTC 2012



> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel-
> bounces at rubyforge.org] On Behalf Of Heesob Park
> Sent: Sunday, February 26, 2012 2:33 AM
> To: Development and ideas for win32utils projects
> Subject: Re: [Win32utils-devel] ICMP pings on 1.9
> 
> Hi,
> 
> 
> 2012/2/26 Daniel Berger <djberg96 at gmail.com>
> 
> 
> 	Hi,
> 
> 	While making some tweaks to the net-ping library, I noticed that
> I started
> 	getting test failures with 1.9.x on Vista for ICMP pings. A
> simple program
> 	should demonstrate:
> 
> 	require 'net/ping'
> 	npi = Net::Ping::ICMP.new('localhost')
> 	p npi.ping?
> 
> 	icmp.rb:109:in `send': An address incompatible with the requested
> protocol
> 	was used. - send(2) (Errno::EAFNOSUPPORT)
> 	       from icmp.rb:109:in `ping'
> 	       from icmp.rb:184:in `<main>'
> 
> 	Where line 109 (using the latest git repo) is:
> 
> 	socket.send(msg, 0, saddr)
> 
> 	I don't see this failure using 1.8, or even 1.9 on Unix
> platforms. Any
> 	ideas?
> 
> 
> 
> 
> On Windows Vista (and Windows 7), the host "localhost"  translated into
> "::1" IPv6 Loopback address instead of "127.0.0.1" IPv4 Loopback
> address.
> You can check it with "ping localhost" in command prompt.
> 
> You must use "127.0.0.1" instead of "localhost" for this test case.
> 
> Refer to http://stackoverflow.com/questions/2370388/socketexception-
> address-incompatible-with-requested-protocol

Thank you for the information. However, I'm confused why the tests pass on Vista with 1.8.7 then. I would think they would fail regardless of which version of Ruby I am using.

My apologies if I have misunderstood.

Regards,

Dan



More information about the win32utils-devel mailing list