From 7096b8df82eebfe857e0043bc8a853353bd78480 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 25 Jan 2001 21:59:39 +0000 Subject: Initial revision --- samples/daytimeclnt.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 samples/daytimeclnt.lua (limited to 'samples/daytimeclnt.lua') 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 @@ +host = host or "127.0.0.1" +port = port or 13 +if arg then + host = arg[1] or host + port = arg[2] or port +end +host = toip(host) +udp = udpsocket() +print("Using host '" ..host.. "' and port " ..port.. "...") +err = sendto(udp, "anything", host, port) +if err then print(err) exit() end +dgram, err = receive(udp) +if not dgram then print(err) exit() end +write(dgram) -- cgit v1.2.3-55-g6feb