mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-13 06:04:31 +02:00
Almost ready to release beta3
This commit is contained in:
@ -12,10 +12,11 @@ if arg then
|
||||
port = arg[2] or port
|
||||
end
|
||||
print("Binding to host '" ..host.. "' and port " ..port.. "...")
|
||||
udp = socket.try(socket.udp())
|
||||
socket.try(udp:setsockname(host, port))
|
||||
socket.try(udp:settimeout(5))
|
||||
ip, port = socket.try(udp:getsockname())
|
||||
udp = assert(socket.udp())
|
||||
assert(udp:setsockname(host, port))
|
||||
assert(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