Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.7
    • Fix Version/s: JRuby 1.7.0.pre2
    • Component/s: Standard Library
    • Labels:
      None
    • Environment:
      Linux 3.0.0-16-generic #29-Ubuntu SMP Tue Feb 14 12:48:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
      jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [linux-amd64-java]
    • Number of attachments :
      0

      Description

      jruby-1.6.7 :001 > require 'socket'
       => true 
      jruby-1.6.7 :002 > Socket.new( :INET, :STREAM )
      ArgumentError: wrong number of arguments (2 for 3)
      	from org/jruby/RubyIO.java:876:in `new'
      	from (irb):2:in `evaluate'
      	from org/jruby/RubyKernel.java:1088:in `eval'
      	from org/jruby/RubyKernel.java:1410:in `loop'
      	from org/jruby/RubyKernel.java:1197:in `catch'
      	from org/jruby/RubyKernel.java:1197:in `catch'
      	from /home/zapotek/.rvm/rubies/jruby-1.6.7/bin/jirb:17:in `(root)'
      jruby-1.6.7 :003 > Socket.new( :INET, :STREAM, 0 )
      TypeError: can't convert Symbol into Integer
      	from org/jruby/ext/socket/RubySocket.java:215:in `initialize'
      	from org/jruby/RubyIO.java:876:in `new'
      	from (irb):3:in `evaluate'
      	from org/jruby/RubyKernel.java:1088:in `eval'
      	from org/jruby/RubyKernel.java:1410:in `loop'
      	from org/jruby/RubyKernel.java:1197:in `catch'
      	from org/jruby/RubyKernel.java:1197:in `catch'
      	from /home/zapotek/.rvm/rubies/jruby-1.6.7/bin/jirb:17:in `(root)'
      
      irb(main):001:0> require 'socket'
      => true
      irb(main):002:0> Socket.new( :INET, :STREAM )
      => #<Socket:fd 5>
      irb(main):003:0> Socket.new( :INET, :STREAM, 0 )
      => #<Socket:fd 6>
      

        Issue Links

          Activity

          Hide
          Hiro Asari added a comment -

          It works on master on my MBP. Please try it there. There won't be another 1.6.x release. It could be Linux specific, too.

          irb(main):001:0> RUBY_DESCRIPTION
          => "jruby 1.7.0.preview2.dev (ruby-1.9.3-p203) (2012-06-17 b830efc) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_04) [darwin-x86_64-java]"
          irb(main):002:0> require 'socket'
          => true
          irb(main):003:0> Socket.new( :INET, :STREAM )
          => #<Socket:fd 199>
          
          Show
          Hiro Asari added a comment - It works on master on my MBP. Please try it there. There won't be another 1.6.x release. It could be Linux specific, too. irb(main):001:0> RUBY_DESCRIPTION => "jruby 1.7.0.preview2.dev (ruby-1.9.3-p203) (2012-06-17 b830efc) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_04) [darwin-x86_64-java]" irb(main):002:0> require 'socket' => true irb(main):003:0> Socket.new( :INET, :STREAM ) => #<Socket:fd 199>
          Hide
          Tasos Laskos added a comment -

          Yep, that worked but I found another bug:

          jruby-head :002 > require 'socket'
           => true 
          jruby-head :003 > Socket.new( :INET, :STREAM, 0 ).bind( Addrinfo.tcp( "127.0.0.1", 9999 ) )
          TypeError: can't convert Addrinfo into String
          	from org/jruby/ext/socket/RubySocket.java:211:in `bind'
          	from (irb):3:in `evaluate'
          	from org/jruby/RubyKernel.java:1045:in `eval'
          	from org/jruby/RubyKernel.java:1361:in `loop'
          	from org/jruby/RubyKernel.java:1154:in `catch'
          	from org/jruby/RubyKernel.java:1154:in `catch'
          	from /home/zapotek/.rvm/rubies/jruby-head/bin/irb:17:in `(root)'
          
          irb(main):001:0> require 'socket'
          => true
          irb(main):002:0> Socket.new( :INET, :STREAM, 0 ).bind( Addrinfo.tcp( "127.0.0.1", 9999 ) )
          => 0
          
          Show
          Tasos Laskos added a comment - Yep, that worked but I found another bug: jruby-head :002 > require 'socket' => true jruby-head :003 > Socket.new( :INET, :STREAM, 0 ).bind( Addrinfo.tcp( "127.0.0.1", 9999 ) ) TypeError: can't convert Addrinfo into String from org/jruby/ext/socket/RubySocket.java:211:in `bind' from (irb):3:in `evaluate' from org/jruby/RubyKernel.java:1045:in `eval' from org/jruby/RubyKernel.java:1361:in `loop' from org/jruby/RubyKernel.java:1154:in `catch' from org/jruby/RubyKernel.java:1154:in `catch' from /home/zapotek/.rvm/rubies/jruby-head/bin/irb:17:in `(root)' irb(main):001:0> require 'socket' => true irb(main):002:0> Socket.new( :INET, :STREAM, 0 ).bind( Addrinfo.tcp( "127.0.0.1", 9999 ) ) => 0
          Hide
          Hiro Asari added a comment -

          That's a different error. Addrinfo is apparently not fully implemented. See JRUBY-6393. Do you mind opening a separate ticket?

          Thank you.

          Show
          Hiro Asari added a comment - That's a different error. Addrinfo is apparently not fully implemented. See JRUBY-6393 . Do you mind opening a separate ticket? Thank you.
          Hide
          Hiro Asari added a comment -

          Correction. It is not implementing Addrinfo, but handling it in Socket#bind. At any rate, it is a separate problem.

          Show
          Hiro Asari added a comment - Correction. It is not implementing Addrinfo, but handling it in Socket#bind. At any rate, it is a separate problem.

            People

            • Assignee:
              Hiro Asari
              Reporter:
              Tasos Laskos
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: