[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: luasocket tcp: bad received data
- From: Enrico Colombini <erix@...>
- Date: Fri, 12 Oct 2007 18:58:45 +0200
I just tried luasocket (Windows version) but I only seem to get garbage
data. I guess I should have made some stupid mistake.
Here's what I did:
- downloaded luasocket-2.0.1-lua5.1-win32.zip from LuaForge
- downloaded lua5_1_2_Win32_bin.zip from LuaBinaries (LuaForge)
- setup LUA_PATH, LUA_CPATH as directed
- tried the http example in the docs. It worked
(even if it just crashed when I used a statically compiled Lua 5.1)
This is my code:
socket = require("socket")
client = socket.tcp()
-- connect to my router's telnet port
res,err = client:connect('192.168.127.1', 23)
-- all OK till here
res,err = client:receive('*l')
for i = 1, #res do
The router should say "BusyBox on (none) login:"
(that's what I get with telnet).
This is the actual output:
There is no more data (a second receive() blocks until timeout).
What did I do wrong?