Skip to content

Socket.new protocol parameter should be optional in 1.9 mode #2032

Closed
frodsan opened this Issue Nov 19, 2012 · 2 comments

3 participants

@frodsan
frodsan commented Nov 19, 2012

When I create a new Socket without giving a protocol, Rubinius 1.9 mode expects a protocol parameters:

>> require 'socket'
=> true
>> Socket.new(:UNIX, :DGRAM)
ArgumentError: method 'initialize': given 2, expected 3

But Ruby 1.9 uses 0 internally as the default:

>> require 'socket'
=> true
>> Socket.new(:INET, :DGRAM)
=> #<Socket:fd 5>
@jc00ke
Rubinius member
jc00ke commented Nov 19, 2012

Looks like 1.8.7 requires a 3rd param but 1.9.3 doesn't.

@frodsan
frodsan commented Nov 19, 2012

Yes, I will send a PR now that you merged last one. Thanks to verify.

@brixen brixen pushed a commit that closed this issue Nov 20, 2012
Francesco Rodriguez Fix Socket#new on X19.
When I create a new Socket without giving a protocol,
Rubinius 1.9 mode should use 0 internally as the default
like Ruby 1.9.3:

    >> require 'socket'
    => true
    >> Socket.new(Socket::PF_UNIX, :DGRAM)
    => #<Socket:fd 5>

Fixes #2032.
21fee9d
@brixen brixen closed this in 21fee9d Nov 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.