diff options
Diffstat (limited to 'samples/daytimeclnt.lua')
-rw-r--r-- | samples/daytimeclnt.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/samples/daytimeclnt.lua b/samples/daytimeclnt.lua index 1107c6a..000dfd5 100644 --- a/samples/daytimeclnt.lua +++ b/samples/daytimeclnt.lua | |||
@@ -4,11 +4,11 @@ if arg then | |||
4 | host = arg[1] or host | 4 | host = arg[1] or host |
5 | port = arg[2] or port | 5 | port = arg[2] or port |
6 | end | 6 | end |
7 | host = toip(host) | 7 | host = socket.toip(host) |
8 | udp = udpsocket() | 8 | udp = socket.udp() |
9 | print("Using host '" ..host.. "' and port " ..port.. "...") | 9 | print("Using host '" ..host.. "' and port " ..port.. "...") |
10 | err = udp:sendto("anything", host, port) | 10 | err = udp:sendto("anything", host, port) |
11 | if err then print(err) exit() end | 11 | if err then print(err) exit() end |
12 | dgram, err = udp:receive() | 12 | dgram, err = udp:receive() |
13 | if not dgram then print(err) exit() end | 13 | if not dgram then print(err) exit() end |
14 | write(dgram) | 14 | io.write(dgram) |