If I run, create a server, everything is running well.
When a client connects to the server and then I kill the server, I can't start the server again (for 20-40 seconds).
Kill the server with this code:
self.server.socket:close()
self.server = nil
And here is the errormsg (if I try to run, create the server after the kill):
Error: ./lib/LUBE/LUBE.lua:430: calling 'accept' on bad self (tcp{server} expected, got userdata)
stack traceback:
[C]: in function 'accept'
./lib/LUBE/LUBE.lua:430: in function 'accept'
./lib/LUBE/LUBE.lua:205: in function 'update'
./class/Server.lua:84: in function 'update'
[string "main.lua"]:72: in function 'update'
[string "boot.lua"]:320: in function <[string "boot.lua"]:308>
[C]: in function 'xpcall'
How can I kill a server correctly? Is this a bug or a fail by me?
My email reply never made it here, I see, anyway, here's the message:
You should use LUBE's closing, but otherwise it's an OS "feature", I should probably set reuseaddr.
If I run, create a server, everything is running well.
When a client connects to the server and then I kill the server, I can't start the server again (for 20-40 seconds).
Kill the server with this code:
And here is the errormsg (if I try to run, create the server after the kill):
How can I kill a server correctly? Is this a bug or a fail by me?