From: Matthew Margolis Date: 2005-03-03T04:33:16+09:00 Subject: Re: TCPSocket and windows Bill Kelly wrote: >Hi, > >From: "Matthew Margolis" > > >>I can not get a working TCPSocket under windows with ruby 1.8.2. It >>just hangs. Is there currently a solution for this problem? >> >> > >Could you post your code? I've used TCPSocket (and UDPSocket) >heavily under Win32 ruby since, I think version 1.6.4... Currently >running ruby 1.8.2 (2004-12-25) [i386-mswin32]. > > >Regards, > >Bill > > > > sure ----------------- require 'Timeout' require 'socket' time =5 begin Timeout.timeout(time) do s = TCPSocket.new("google.com", "echo") puts "fish" s.close end rescue Timeout::Error puts "Timed out" end ---------------- I couldn't get ping.rb(stdlib) to work so I tried my own version and it doesn't work either. -Matt Margolis