mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-12 22:03:31 +02:00
Adjusted some details, got rid of old files, added some new.
This commit is contained in:
@ -14,8 +14,9 @@ host = socket.dns.toip(host)
|
||||
udp = socket.udp()
|
||||
print("Using host '" ..host.. "' and port " ..port.. "...")
|
||||
udp:setpeername(host, port)
|
||||
udp:settimeout(3)
|
||||
sent, err = udp:send("anything")
|
||||
if err then print(err) exit() end
|
||||
if err then print(err) os.exit() end
|
||||
dgram, err = udp:receive()
|
||||
if not dgram then print(err) exit() end
|
||||
if not dgram then print(err) os.exit() end
|
||||
io.write(dgram)
|
||||
|
Reference in New Issue
Block a user