diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-03-22 04:15:03 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-03-22 04:15:03 +0000 |
commit | 1fa65d89ca5dc64756f7933d7cc3f524e4627dce (patch) | |
tree | df614c8b86b0f7c2f45c2afcacc993ab3c0dcf11 /samples | |
parent | 4919a83d2271a9e43b83c7d488e3f94c850681e3 (diff) | |
download | luasocket-1fa65d89ca5dc64756f7933d7cc3f524e4627dce.tar.gz luasocket-1fa65d89ca5dc64756f7933d7cc3f524e4627dce.tar.bz2 luasocket-1fa65d89ca5dc64756f7933d7cc3f524e4627dce.zip |
Adjusted some details, got rid of old files, added some new.
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) |