aboutsummaryrefslogtreecommitdiff
path: root/samples/daytimeclnt.lua
diff options
context:
space:
mode:
Diffstat (limited to 'samples/daytimeclnt.lua')
-rw-r--r--samples/daytimeclnt.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/samples/daytimeclnt.lua b/samples/daytimeclnt.lua
new file mode 100644
index 0000000..94e03d3
--- /dev/null
+++ b/samples/daytimeclnt.lua
@@ -0,0 +1,14 @@
1host = host or "127.0.0.1"
2port = port or 13
3if arg then
4 host = arg[1] or host
5 port = arg[2] or port
6end
7host = toip(host)
8udp = udpsocket()
9print("Using host '" ..host.. "' and port " ..port.. "...")
10err = sendto(udp, "anything", host, port)
11if err then print(err) exit() end
12dgram, err = receive(udp)
13if not dgram then print(err) exit() end
14write(dgram)