aboutsummaryrefslogtreecommitdiff
path: root/samples/talker.lua
diff options
context:
space:
mode:
Diffstat (limited to 'samples/talker.lua')
-rw-r--r--samples/talker.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/talker.lua b/samples/talker.lua
index d66cf66..688824f 100644
--- a/samples/talker.lua
+++ b/samples/talker.lua
@@ -5,18 +5,18 @@ if arg then
5 port = arg[2] or port 5 port = arg[2] or port
6end 6end
7print("Attempting connection to host '" ..host.. "' and port " ..port.. "...") 7print("Attempting connection to host '" ..host.. "' and port " ..port.. "...")
8c, e = connect(host, port) 8c, e = socket.connect(host, port)
9if not c then 9if not c then
10 print(e) 10 print(e)
11 exit() 11 os.exit()
12end 12end
13print("Connected! Please type stuff (empty line to stop):") 13print("Connected! Please type stuff (empty line to stop):")
14l = read() 14l = io.read()
15while l and l ~= "" and not e do 15while l and l ~= "" and not e do
16 e = c:send(l, "\n") 16 t, e = c:send(l, "\n")
17 if e then 17 if e then
18 print(e) 18 print(e)
19 exit() 19 os.exit()
20 end 20 end
21 l = read() 21 l = io.read()
22end 22end