aboutsummaryrefslogtreecommitdiff
path: root/samples/daytimeclnt.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2001-01-25 21:59:39 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2001-01-25 21:59:39 +0000
commit7096b8df82eebfe857e0043bc8a853353bd78480 (patch)
treef5cdc12138e9526896ff5f8fe9e3ffaa0c47fc0c /samples/daytimeclnt.lua
parent68f51243b38bf1e32d471e9cc9ddf12a25110e80 (diff)
downloadluasocket-7096b8df82eebfe857e0043bc8a853353bd78480.tar.gz
luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.tar.bz2
luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.zip
Initial revision
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)