[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Server socket problem
- From: Stefan Reich <stefan.reich.maker.of.eye@...>
- Date: Sat, 6 Aug 2011 18:27:11 +0200
Hi again everyone... this time, a prob with sockets. I am doing this
on Lua 5.1.4 (stock Lua for Windows), Windows Vista:
sockettest.lua
===
require "socket"
port = 9977
print("Setting up TCP server on port "..tostring(port))
tcp = socket.tcp()
status, err = tcp:bind("*", port)
if not status then
print(err)
return
end
print("TCP server running.")
conn = tcp:accept()
And I get:
Setting up TCP server on port 9977
TCP server running.
r:\coding\Lua\5.1\lua.exe:
...rojects\LuaTest\safelua02\taskmantest\sockettest.lua:19: calling
'accept' on bad self (tcp{server} expected, got userdata)
stack traceback:
[C]: in function 'accept'
...rojects\LuaTest\safelua02\taskmantest\sockettest.lua:19: in
main chunk
[C]: ?
What's up with that? Google does not really give me anything when I
look up the error msg...
Stefan