diff options
Diffstat (limited to 'samples/talker.lua')
-rw-r--r-- | samples/talker.lua | 12 |
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 |
6 | end | 6 | end |
7 | print("Attempting connection to host '" ..host.. "' and port " ..port.. "...") | 7 | print("Attempting connection to host '" ..host.. "' and port " ..port.. "...") |
8 | c, e = connect(host, port) | 8 | c, e = socket.connect(host, port) |
9 | if not c then | 9 | if not c then |
10 | print(e) | 10 | print(e) |
11 | exit() | 11 | os.exit() |
12 | end | 12 | end |
13 | print("Connected! Please type stuff (empty line to stop):") | 13 | print("Connected! Please type stuff (empty line to stop):") |
14 | l = read() | 14 | l = io.read() |
15 | while l and l ~= "" and not e do | 15 | while 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() |
22 | end | 22 | end |