TCPSocket.open will not accept a string for the port parameter
--------------------------------------------------------------

                 Key: JRUBY-1228
                 URL: http://jira.codehaus.org/browse/JRUBY-1228
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.0.0
         Environment: Mac OS X, Linux
            Reporter: Matt Fletcher
            Priority: Minor


Ruby's TCPSocket.open method will happily accept a string as the port parameter:

socket = TCPSocket.open("waldorf", "7500")
socket.close

This code generates an exception in JRuby:
socket = TCPSocket.open("waldorf", "7500")
TypeError: can't convert String into Integer
        from (irb):4:in `open'
        from (irb):4:in `binding'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:150:in 
`eval_input'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:70:in 
`signal_status'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:189:in 
`eval_input'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:70:in 
`each_top_level_statement'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:190:in `loop'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:190:in 
`catch'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:190:in 
`eval_input'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:70:in `start'
        from :-1:in `catch'
        from /Users/fletcher/Desktop/jruby-1.0/lib/ruby/1.8/irb.rb:71:in `start'
        from :-1

-- 
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