From: Glen Holcomb Date: 2008-08-06T03:40:55+09:00 Subject: Re: rb_sys_fail(socket(2)) - errno == 0 ------=_Part_62640_18146682.1217961743659 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Aug 5, 2008 at 12:34 PM, Phill Davies wrote: > You can use Ping from the Ruby standard library. > > require 'ping' > Ping.pingecho "google.com", , > > Where timeout is the number of seconds to wait for a reply (defaults to > 5) and port is the port to use (defaults to the 'echo' port) > > > Unless you have something more specific you are trying to do this ought > to work. > > Glen Holcomb wrote: > > That is the error message I get when I try either of these methods for > > creating an ICMP packet: > > > > socket = Socket.new(Socket::PF_INET, Socket::SOCK_RAW, > > Socket::IPPROTO_ICMP) > > > > or > > > > with net-ping > > > > icmp = Ping::ICMP.new('machine_name') > > > > icmp.ping? > > > > I am on Windows XP. The account I'm logged in as has local > > administrator > > rights. > > > > > > What I'm trying to do is check to see if a system is up before I try and > > make a WIN32OLE connection to it as they take forever to time-out > > > > -- > > "Hey brother Christian with your high and mighty errand, Your actions > > speak > > so loud, I can't hear a word you're saying." > > > > -Greg Graffin (Bad Religion) > > -- > Posted via http://www.ruby-forum.com/. > > I was actually hoping for something that creates a real ICMP packet as I can't be certain what ports are open on given workstations on the network. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_62640_18146682.1217961743659--