aboutsummaryrefslogtreecommitdiff
path: root/samples/daytimeclnt.lua
diff options
context:
space:
mode:
Diffstat (limited to 'samples/daytimeclnt.lua')
-rw-r--r--samples/daytimeclnt.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/daytimeclnt.lua b/samples/daytimeclnt.lua
index 29abe17..63f4017 100644
--- a/samples/daytimeclnt.lua
+++ b/samples/daytimeclnt.lua
@@ -14,8 +14,9 @@ host = socket.dns.toip(host)
14udp = socket.udp() 14udp = socket.udp()
15print("Using host '" ..host.. "' and port " ..port.. "...") 15print("Using host '" ..host.. "' and port " ..port.. "...")
16udp:setpeername(host, port) 16udp:setpeername(host, port)
17udp:settimeout(3)
17sent, err = udp:send("anything") 18sent, err = udp:send("anything")
18if err then print(err) exit() end 19if err then print(err) os.exit() end
19dgram, err = udp:receive() 20dgram, err = udp:receive()
20if not dgram then print(err) exit() end 21if not dgram then print(err) os.exit() end
21io.write(dgram) 22io.write(dgram)