From: Yukihiro Matsumoto Date: 2007-10-07T00:03:44+09:00 Subject: Re: Ruby Socket: I found a misstake in the doc. Can someone confirm it and who's gonna fix this doc-error? Hi, In message "Re: Ruby Socket: I found a misstake in the doc. Can someone confirm it and who's gonna fix this doc-error?" on Sat, 6 Oct 2007 02:25:05 +0900, kazaam writes: |I'm playing around with sockets in ruby and took a look at the docs(http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/index.html). There are some examples like this here(http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/Socket.html#M004166): | | require 'socket' | include Socket::Constants | socket = Socket.new( AF_INET, SOCK_STREAM, 0 ) | sockaddr = Socket.pack_sockaddr_in( 2200, 'localhost' ) | socket.bind( sockaddr ) | socket.listen( 5 ) | client, client_sockaddr = socket.accept | puts "The client said, '#{socket.readline.chomp}'" | client.puts "Hello from script one!" | socket.close | |But that example is wrong! It has to be client.readline.chomp and not socket.readline.chomp. Take this example by me: It's already updated in the source. I guess ruby-doc.org needs update as well. matz.