Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

BasicSocket.shutdown() is not compliant for >= 1.9.x #1579

Closed
coffeeaddict opened this Issue · 1 comment

3 participants

Hartog C. de Mik Lucas Allan Alex Tambellini
Hartog C. de Mik

Hi,

with the following script:

require 'socket'
require 'json'

puts "v#{RUBY_VERSION}"

start = Time.now
s = TCPSocket.new 'localhost', 1234
s.write({ address: "some-bus-address", payload: { foo: "bar-#{i}" } }.to_json)
s.shutdown(:RDWR)
puts "#{i} Done in %.5fs" % (Time.now - start).to_f

I get the following error:

v1.9.3
TypeError: can't convert Symbol into Integer
  shutdown at org/jruby/ext/socket/RubyBasicSocket.java:379
    (root) at client.rb:14

According to http://www.ruby-doc.org/stdlib-1.9.3/libdoc/socket/rdoc/BasicSocket.html#method-i-shutdown the argument for shutdown can be a number, symbol or a string. This changed since 1.8.x

Alex Tambellini atambo referenced this issue from a commit in atambo/jruby
Alex Tambellini atambo BasicSocket#shutdown should accept strings or symbols
Fixes #1579
4083eb0
Alex Tambellini atambo added this to the JRuby 1.7.13 milestone
Lucas Allan
Collaborator

Fixed by #1663

Lucas Allan lucasallan closed this
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.