summaryrefslogtreecommitdiff
path: root/sample/clnt.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/clnt.rb')
-rw-r--r--sample/clnt.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/sample/clnt.rb b/sample/clnt.rb
index d2c71ec563..c8c4b2db9f 100644
--- a/sample/clnt.rb
+++ b/sample/clnt.rb
@@ -1,5 +1,8 @@
# socket example - client side
# usage: ruby clnt.rb [host] port
+
+require "socket"
+
host=(if $ARGV.length == 2; $ARGV.shift; else "localhost"; end)
print("Trying ", host, " ...")
STDOUT.flush