Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
coffeeaddict opened this issue Mar 25, 2014 · 1 comment
Closed

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

coffeeaddict opened this issue Mar 25, 2014 · 1 comment
Milestone

Comments

@coffeeaddict
Copy link

@coffeeaddict coffeeaddict commented Mar 25, 2014

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

@lucasallan
Copy link
Member

@lucasallan lucasallan commented Apr 26, 2014

Fixed by #1663

@lucasallan lucasallan closed this Apr 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants