blob: d66cf661fbe475f1769fce380fcea63f7beb0456 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
host = host or "localhost"
port = port or 8080
if arg then
host = arg[1] or host
port = arg[2] or port
end
print("Attempting connection to host '" ..host.. "' and port " ..port.. "...")
c, e = connect(host, port)
if not c then
print(e)
exit()
end
print("Connected! Please type stuff (empty line to stop):")
l = read()
while l and l ~= "" and not e do
e = c:send(l, "\n")
if e then
print(e)
exit()
end
l = read()
end
|