[MacRuby-devel] [MacRuby] #754: TCP socket is disconnected when used IO#gets and IO#puts.
MacRuby
ruby-noreply at macosforge.org
Sun Jun 20 04:55:56 PDT 2010
#754: TCP socket is disconnected when used IO#gets and IO#puts.
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
{{{
require 'socket'
host = "127.0.0.1"
port = 10000
serv = TCPServer.new(host, port)
s = serv.accept
loop do
line = s.gets
s.puts("PUT: " + line)
exit if(line.chomp == "quit")
end
}}}
I connected to above echo server with telnet, then typed words.
{{{
$ telnet 127.0.0.1 10000
hello world
PUT: hello world
Connection closed by foreign host.
}}}
A socket is disconnected when used IO#gets and IO#puts.
--
Ticket URL: <http://www.macruby.org/trac/ticket/754>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list