diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-01-02 22:44:00 +0000 |
commit | 97b26e0b66c840a446a0179200c7df23565330d1 (patch) | |
tree | 272f9ea0451f13b563451fb8df21a03669e90d09 /samples/echosrvr.lua | |
parent | a8254e94f8c14ac15b02be53a1cc69ba80899230 (diff) | |
download | luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.gz luasocket-97b26e0b66c840a446a0179200c7df23565330d1.tar.bz2 luasocket-97b26e0b66c840a446a0179200c7df23565330d1.zip |
Almost ready to release beta3
Diffstat (limited to 'samples/echosrvr.lua')
-rw-r--r-- | samples/echosrvr.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/samples/echosrvr.lua b/samples/echosrvr.lua index 3ebbe85..d4449e5 100644 --- a/samples/echosrvr.lua +++ b/samples/echosrvr.lua | |||
@@ -12,10 +12,11 @@ if arg then | |||
12 | port = arg[2] or port | 12 | port = arg[2] or port |
13 | end | 13 | end |
14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") | 14 | print("Binding to host '" ..host.. "' and port " ..port.. "...") |
15 | udp = socket.try(socket.udp()) | 15 | udp = assert(socket.udp()) |
16 | socket.try(udp:setsockname(host, port)) | 16 | assert(udp:setsockname(host, port)) |
17 | socket.try(udp:settimeout(5)) | 17 | assert(udp:settimeout(5)) |
18 | ip, port = socket.try(udp:getsockname()) | 18 | ip, port = udp:getsockname() |
19 | assert(ip, port) | ||
19 | print("Waiting packets on " .. ip .. ":" .. port .. "...") | 20 | print("Waiting packets on " .. ip .. ":" .. port .. "...") |
20 | while 1 do | 21 | while 1 do |
21 | dgram, ip, port = udp:receivefrom() | 22 | dgram, ip, port = udp:receivefrom() |