net/servertest.lua
Ryan Ward 859ae91395 Reworking the library
netold contains the older library. the new library has all the core features that  was in the old library.
2018-06-15 11:29:27 -04:00

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()