Porting to LUA 5.0 final

This commit is contained in:
Diego Nehab 2003-05-25 01:54:13 +00:00
parent c1ef3e7103
commit 0f6c8d50a9
32 changed files with 1539 additions and 1128 deletions

View file

@ -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

View file

@ -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