diff options
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/daytimeclnt.lua | 5 |
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) | |||
| 14 | udp = socket.udp() | 14 | udp = socket.udp() |
| 15 | print("Using host '" ..host.. "' and port " ..port.. "...") | 15 | print("Using host '" ..host.. "' and port " ..port.. "...") |
| 16 | udp:setpeername(host, port) | 16 | udp:setpeername(host, port) |
| 17 | udp:settimeout(3) | ||
| 17 | sent, err = udp:send("anything") | 18 | sent, err = udp:send("anything") |
| 18 | if err then print(err) exit() end | 19 | if err then print(err) os.exit() end |
| 19 | dgram, err = udp:receive() | 20 | dgram, err = udp:receive() |
| 20 | if not dgram then print(err) exit() end | 21 | if not dgram then print(err) os.exit() end |
| 21 | io.write(dgram) | 22 | io.write(dgram) |
