[#39863] forループの速度 — Masahiro Sato <msato@...>

15 messages 2004/07/20

[#39868] イテレータとfor文 — OOTANI TAKASHI <otn@...5.so-net.ne.jp>

大谷と申します。

31 messages 2004/07/20
[#39886] Re: イテレータとfor文 — Tietew <tietew-ml-ruby-list@...> 2004/07/21

[ruby-list:39904] ping.rbのエラーについて

From: ISIHARA HIROSI <ishihara-h@...>
Date: 2004-07-23 03:54:36 UTC
List: ruby-list #39904
関電興業 石原です。

RedHat Linux9 でrubyを使用しているのですが、
ping.rb で以下のようにエラーが発生します。
(rubyはソースからmakeしたものです。 make test は通ってます)

$ ruby -ve 'require "ping"; p Ping::pingecho("10.xx.xx.61",1)'
ruby 1.8.1 (2003-12-25) [i686-linux]
true
$ ruby -ve 'require "ping"; p Ping::pingecho("10.xx.xx.62",1)'
ruby 1.8.1 (2003-12-25) [i686-linux]
/usr/local/lib/ruby/1.8/timeout.rb:42:in `new': execution expired
(Timeout::Error)
        from /usr/local/lib/ruby/1.8/ping.rb:47:in `pingecho'
        from /usr/local/lib/ruby/1.8/ping.rb:46:in `timeout'
        from /usr/local/lib/ruby/1.8/timeout.rb:55:in `timeout'
        from /usr/local/lib/ruby/1.8/ping.rb:46:in `pingecho'
        from -e:1
なお一部伏字にしていますが10.xx.xx.61はネットワーク上に存在します。
10.xx.xx.62は存在しません。

身近のFreeBSDで試してみたのですが(バージョン1.6でも1.8でも)
存在しないIPに対してもエラーになりません。
(rubyはパッケージで導入しています)
%ruby18 -ve 'require "ping"; p Ping::pingecho("10.xx.xx.253",5)'
ruby 1.8.0 (2003-09-09) [i386-freebsd4]
false
%ruby16 -ve 'require "ping"; p Ping::pingecho("10.xx.xx.253",5)'
ruby 1.6.8 (2003-03-26) [i386-freebsd4]
false
エラーメッセージから原因はtimeoutまわりのようですが、
よくわかりません。なにか対応方法はありますでしょうか。

よろしくお願いします。

                           関電興業 石原<ishihara-h@kanden-kogyo.co.jp>



In This Thread

Prev Next