Adjusted a few inconsistencies with the manual.
This commit is contained in:
parent
3099704aff
commit
c51d4acf1c
20 changed files with 412 additions and 156 deletions
|
@ -10,17 +10,17 @@ if arg then
|
|||
host = arg[1] or host
|
||||
port = arg[2] or port
|
||||
end
|
||||
host = socket.toip(host)
|
||||
host = socket.dns.toip(host)
|
||||
udp, err = socket.udp()
|
||||
if not udp then print(err) exit() end
|
||||
err = udp:setpeername(host, port)
|
||||
if err then print(err) exit() end
|
||||
assert(udp, err)
|
||||
ret, err = udp:setpeername(host, port)
|
||||
assert(ret, err)
|
||||
print("Using host '" ..host.. "' and port " .. port .. "...")
|
||||
while 1 do
|
||||
line = io.read()
|
||||
if not line then os.exit() end
|
||||
err = udp:send(line)
|
||||
if err then print(err) os.exit() end
|
||||
ret, err = udp:send(line)
|
||||
if not ret then print(err) os.exit() end
|
||||
dgram, err = udp:receive()
|
||||
if not dgram then print(err) os.exit() end
|
||||
print(dgram)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue