[BUG] Socket API inconsistent with MRI
Reported by gnufied | November 17th, 2007 @ 05:42 AM | in 1.0
require "socket"
lol = TCPSocket.open("localhost",11001)
Throws:
An exception has occurred:
wrong number of arguments (got 2, required 1) (ArgumentError)
Backtrace:
TCPSocket.open at kernel/core/io.rb:0
main.__script__ at use_socke.rb:3
CompiledMethod#as_script at kernel/bootstrap/primitives.rb:41
main.load at kernel/core/compile.rb:95
main.__script__ at kernel/loader.rb:190
Now, for this:
spc = TCPSocket.new("localhost",11001)
An exception has occurred:
Unable to set socket option (Protocol not available) (ENOPROTOOPT)
Backtrace:
Errno.handle at /home/gnufied/checkout/code/lib/socket.rb:22
BasicSocket(TCPSocket)#setsockopt at /home/gnufied/checkout/code/lib/socket.rb:71
Now,for this:
lol = TCPSocket.new("localhost",11001,true)
p lol.gets
it returns nil.
Comments and changes to this ticket
-
Tilman Sauerbeck November 17th, 2007 @ 01:34 PM
- → State changed from new to open
I fixed the ::open issue in 453b00183d911dd45a2538c5dc4ffd3ded0a570f.
-
Tilman Sauerbeck November 18th, 2007 @ 10:26 AM
Fixed bad SOL_SOCKET and SO_REUSEADDR values in 4b0144bac8acd91c33173aac414952d7168977ec.
-

-
Eero Saynatkari November 18th, 2007 @ 10:50 PM
- → Milestone changed from 1.0 preview to 1.0
A) The title is, uh, ambiguous?
B) Can this be considered resolved?
-

gnufied November 19th, 2007 @ 02:49 AM
Hmm, at least open issue is resolved, please close this ticket. Sorry for misleading/ambiguous title.
-
Tilman Sauerbeck November 19th, 2007 @ 04:41 AM
One open issue remains: MRI accepts different arguments to TCPSocket#initialize and UDPSocket#initialize than Rubinius.
I'm on it :D
-
Eero Saynatkari November 19th, 2007 @ 05:25 PM
- → Title changed from Screwed socket API to Socket API inconsistent with MRI
-
Eero Saynatkari January 20th, 2008 @ 01:16 PM
- → State changed from open to resolved
- → Title changed from Socket API inconsistent with MRI to [BUG] Socket API inconsistent with MRI
This should be resolved with the recent Socket work. File a new ticket if there are remaining issues.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
