diff options
Diffstat (limited to 'samples/echoclnt.lua')
-rw-r--r-- | samples/echoclnt.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/samples/echoclnt.lua b/samples/echoclnt.lua index d1c56c7..043b2f0 100644 --- a/samples/echoclnt.lua +++ b/samples/echoclnt.lua | |||
@@ -7,15 +7,15 @@ end | |||
7 | host = toip(host) | 7 | host = toip(host) |
8 | udp, err = udpsocket() | 8 | udp, err = udpsocket() |
9 | if not udp then print(err) exit() end | 9 | if not udp then print(err) exit() end |
10 | err = setpeername(udp, host, port) | 10 | err = udp:setpeername(host, port) |
11 | if err then print(err) exit() end | 11 | if err then print(err) exit() end |
12 | print("Using host '" ..host.. "' and port " ..port.. "...") | 12 | print("Using host '" ..host.. "' and port " .. port .. "...") |
13 | while 1 do | 13 | while 1 do |
14 | line = read() | 14 | line = read() |
15 | if not line then exit() end | 15 | if not line then exit() end |
16 | err = send(udp, line) | 16 | err = udp:send(line) |
17 | if err then print(err) exit() end | 17 | if err then print(err) exit() end |
18 | dgram, err = receive(udp) | 18 | dgram, err = udp:receive() |
19 | if not dgram then print(err) exit() end | 19 | if not dgram then print(err) exit() end |
20 | print(dgram) | 20 | print(dgram) |
21 | end | 21 | end |