mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-13 06:04:31 +02:00
Adjusted a few inconsistencies with the manual.
This commit is contained in:
@ -12,11 +12,12 @@ if arg then
|
||||
end
|
||||
print("Binding to host '" ..host.. "' and port " ..port.. "...")
|
||||
udp, err = socket.udp()
|
||||
if not udp then print(err) os.exit() end
|
||||
err = udp:setsockname(host, port)
|
||||
if err then print(err) os.exit() end
|
||||
udp:timeout(5)
|
||||
assert(udp, err)
|
||||
ret, err = udp:setsockname(host, port)
|
||||
assert(ret, err)
|
||||
udp:settimeout(5)
|
||||
ip, port = udp:getsockname()
|
||||
assert(ip, port)
|
||||
print("Waiting packets on " .. ip .. ":" .. port .. "...")
|
||||
while 1 do
|
||||
dgram, ip, port = udp:receivefrom()
|
||||
|
Reference in New Issue
Block a user