summaryrefslogtreecommitdiff
path: root/sample/tsvr.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-19 20:56:37 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-19 20:56:37 +0000
commit02a8d06fa8833db3c266663f31a82deb6e89b2d9 (patch)
treef322774139b892603c027ac385f2d6e73852ca77 /sample/tsvr.rb
parentc37140b3519fd8028d3b720bbb76c14af2c4e093 (diff)
Improve.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/tsvr.rb')
-rw-r--r--sample/tsvr.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/sample/tsvr.rb b/sample/tsvr.rb
index 8b019bd..52cdd32 100644
--- a/sample/tsvr.rb
+++ b/sample/tsvr.rb
@@ -8,11 +8,11 @@ addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
-while TRUE
+loop do
Thread.start(gs.accept) do |s|
print(s, " is accepted\n")
- while s.gets
- s.write($_)
+ while line = s.gets
+ s.write(line)
end
print(s, " is gone\n")
s.close