netold contains the older library. the new library has all the core features that was in the old library.
16 lines
312 B
Lua
16 lines
312 B
Lua
package.path="?/init.lua;"..package.path
|
|
require("multi")
|
|
require("net")
|
|
port=12344
|
|
udp=assert(socket.udp())
|
|
udp:settimeout(0)
|
|
udp:setsockname("*", port)
|
|
multi:newLoop(function()
|
|
local data,ip,port=udp:receivefrom()
|
|
if data then
|
|
print(data)
|
|
udp:sendto("Hey Client!\n", ip, port)
|
|
end
|
|
end)
|
|
multi:mainloop()
|