source:
EcnlProtoTool/trunk/prototool/src/echo_server.rb@
373
Last change on this file since 373 was 321, checked in by , 7 years ago | |
---|---|
|
|
File size: 186 bytes |
Line | |
---|---|
1 | |
2 | port = if ARGV[0] then ARGV[0] else 'echo' end |
3 | gate = TCPServer.open(port) |
4 | |
5 | sock = gate.accept |
6 | gate.close |
7 | |
8 | while msg = sock.gets |
9 | sock.write(msg) |
10 | print("you get:", msg) |
11 | end |
12 | sock.close |
Note:
See TracBrowser
for help on using the repository browser.