Porting to LUA 5.0 final
This commit is contained in:
parent
c1ef3e7103
commit
0f6c8d50a9
32 changed files with 1539 additions and 1128 deletions
|
@ -7,7 +7,8 @@ end
|
|||
host = socket.toip(host)
|
||||
udp = socket.udp()
|
||||
print("Using host '" ..host.. "' and port " ..port.. "...")
|
||||
err = udp:sendto("anything", host, port)
|
||||
udp:setpeername(host, port)
|
||||
sent, err = udp:send("anything")
|
||||
if err then print(err) exit() end
|
||||
dgram, err = udp:receive()
|
||||
if not dgram then print(err) exit() end
|
||||
|
|
|
@ -5,18 +5,18 @@ if arg then
|
|||
port = arg[2] or port
|
||||
end
|
||||
print("Attempting connection to host '" ..host.. "' and port " ..port.. "...")
|
||||
c, e = connect(host, port)
|
||||
c, e = socket.connect(host, port)
|
||||
if not c then
|
||||
print(e)
|
||||
exit()
|
||||
os.exit()
|
||||
end
|
||||
print("Connected! Please type stuff (empty line to stop):")
|
||||
l = read()
|
||||
l = io.read()
|
||||
while l and l ~= "" and not e do
|
||||
e = c:send(l, "\n")
|
||||
t, e = c:send(l, "\n")
|
||||
if e then
|
||||
print(e)
|
||||
exit()
|
||||
os.exit()
|
||||
end
|
||||
l = read()
|
||||
l = io.read()
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue