source: EcnlProtoTool/trunk/prototool/src/echo_server.rb@ 279

Last change on this file since 279 was 279, checked in by coas-nagasima, 7 years ago

ファイルを追加、更新。

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby
File size: 186 bytes
Line 
1
2port = if ARGV[0] then ARGV[0] else 'echo' end
3gate = TCPServer.open(port)
4
5sock = gate.accept
6gate.close
7
8while msg = sock.gets
9 sock.write(msg)
10 print("you get:", msg)
11end
12sock.close
Note: See TracBrowser for help on using the repository browser.