diff options
Diffstat (limited to 'sample/clnt.rb')
-rw-r--r-- | sample/clnt.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sample/clnt.rb b/sample/clnt.rb new file mode 100644 index 0000000000..639e2a0daf --- /dev/null +++ b/sample/clnt.rb @@ -0,0 +1,12 @@ +host=(if $ARGV.length == 2; $ARGV.shift; else "localhost"; end) +print("Trying ", host, " ...") +$stdout.flush +s = TCPsocket.open(host, $ARGV.shift) +print(" done\n") +print("addr: ", s.addr.join(":"), "\n") +print("peer: ", s.peeraddr.join(":"), "\n") +while gets() + s.write($_) + print(s.gets) +end +s.close |