JRUBY-2211 fix doesn't work if the destination machine is up but the 
destination port is down. 
-----------------------------------------------------------------------------------------------

                 Key: JRUBY-4627
                 URL: http://jira.codehaus.org/browse/JRUBY-4627
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.4
         Environment: Windows XP
P4 2.4 Ghz
JRuby 1.4.0
SNMP gem v1.0.2 
            Reporter: nao16t
             Fix For: JRuby 1.5


JRUBY-2211 fix works OK if the destination machine is down. 
However JRUBY-2211 fix doesn't work if the destination machine is up but the 
destination port is down. 

Please compare the following results between CRuby 1.8.6 and JRuby 1.4.0.
snmptest.rb is attached JRUBY-2211. I changed only IP address.

JRuby's UDPSocket#recv hangs up but CRuby's returns Errno::ECONNRESET.
And the fourth argument of JRuby's UDPSocket#send has to be Integer, but 
CRuby's can be either String or Integer.
-------------------------------------------------------------------------------------------

C:\>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\>ping 192.168.1.170

Pinging 192.168.1.170 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.1.170:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\>ruby snmptest.rb
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:239:in 
`get_next': host 192.168.1.170 not responding (SNMP::RequestTimeout)
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:399:in 
`walk'
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:398:in 
`loop'
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:398:in 
`walk'
        from snmptest.rb:4
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:178:in 
`open'
        from snmptest.rb:3

C:\>ping 192.168.1.17

Pinging 192.168.1.17 with 32 bytes of data:

Reply from 192.168.1.17: bytes=32 time<1ms TTL=128
Reply from 192.168.1.17: bytes=32 time<1ms TTL=128
Reply from 192.168.1.17: bytes=32 time<1ms TTL=128
Reply from 192.168.1.17: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.17:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>ruby snmptest.rb
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:461: 
warning: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvfrom(2)
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:461: 
warning: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvfrom(2)
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:461: 
warning: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvfrom(2)
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:461: 
warning: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvfrom(2)
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:461: 
warning: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvfrom(2)
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:461: 
warning: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvfrom(2)
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:239:in 
`get_next': host 192.168.1.17 not responding (SNMP::RequestTimeout)
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:399:in 
`walk'
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:398:in 
`loop'
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:398:in 
`walk'
        from snmptest.rb:4
        from 
C:/win32app/ruby/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:178:in 
`open'
        from snmptest.rb:3

-------------------------------------------------------------------------------------------

C:\>jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) 
Client VM 1.6.0_17) [x86-java]

C:\>ping 192.168.1.170

Pinging 192.168.1.170 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.1.170:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\>jruby snmptest.rb
c:/win32app/jruby-1.4.0/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:239:in
 `get_next': host 192.168.1.170 not responding (SNMP::RequestTimeout)
        from 
c:/win32app/jruby-1.4.0/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:399:in
 `walk'
        from 
c:/win32app/jruby-1.4.0/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:398:in
 `loop'
        from 
c:/win32app/jruby-1.4.0/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:398:in
 `walk'
        from snmptest.rb:4
        from 
c:/win32app/jruby-1.4.0/lib/ruby/gems/1.8/gems/snmp-1.0.2/lib/snmp/manager.rb:178:in
 `open'
        from snmptest.rb:3

C:\>ping 192.168.1.17

Pinging 192.168.1.17 with 32 bytes of data:

Reply from 192.168.1.17: bytes=32 time<1ms TTL=128
Reply from 192.168.1.17: bytes=32 time<1ms TTL=128
Reply from 192.168.1.17: bytes=32 time<1ms TTL=128
Reply from 192.168.1.17: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.17:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>jruby snmptest.rb

  -> never return in JRuby


-------------------------------------------------------------------------------------------

C:>irb
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> s = UDPSocket.new
=> #<UDPSocket:0x2c4e440>
irb(main):003:0> s.send('hello', 0, '192.168.1.17', '162')
=> 5
irb(main):004:0> s.recv(6)
Errno::ECONNRESET: 
&#26082;&#23384;&#12398;&#25509;&#32154;&#12399;&#12522;&#12514;&#12540;&#12488;
 
&#12507;&#12473;&#12488;&#12395;&#24375;&#21046;&#30340;&#12395;&#20999;&#26029;&#12373;&#12428;&#12414;&#12375;&#12383;&#12290;
 - recvf
rom(2)
        from (irb):4:in `recv'
        from (irb):4
irb(main):005:0>

C:\>jirb
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> s = UDPSocket.new
=> #<UDPSocket:0xf2225f>
irb(main):003:0> s.send('hello', 0, '192.168.1.17', '162')
TypeError: can't convert String into Integer
        from (irb):4
irb(main):004:0> s.send('hello', 0, '192.168.1.17', 162)
=> 5
irb(main):005:0> s.recv(6)
---------------------------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to