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:
344 bytes
|
Line | |
---|
1 |
|
---|
2 | host = if ARGV[0] then ARGV[0] else 'localhost' end
|
---|
3 | port = if ARGV[1] then ARGV[1] else 'echo' end
|
---|
4 | sock = TCPSocket.open(host, port)
|
---|
5 |
|
---|
6 | while msg = STDIN.gets
|
---|
7 | print("you writed:", msg)
|
---|
8 | #socketã«æ¸ãè¾¼ã
|
---|
9 | sock.write(msg)
|
---|
10 | #ãµã¼ãããè¿ã£ã¦ããã¡ãã»ã¼ã¸ã表示ããã
|
---|
11 | print("return message:", sock.gets)
|
---|
12 | end
|
---|
13 | sock.close
|
---|
Note:
See
TracBrowser
for help on using the repository browser.