lipp / lua-websockets

Websockets for Lua.
http://lipp.github.com/lua-websockets/
MIT License
396 stars 113 forks source link

Sockets not closing on Ctrl-C #70

Closed SyRenity closed 9 years ago

SyRenity commented 9 years ago

It seems the sockets linger after being closed by Ctrl-C, and do not accept new receives on same port, until a timeout passes. The only way to solve this immediately is to change the port.

Is there a proper way to close the sockets?

SyRenity commented 9 years ago

Following more testing, it seems as the websocket actually can be opened on same port, following CTRL-C, at least it returns "bad protocol" in case I submit a non-supported one.

That said, it stops receiving any messages, and have to be relaunched on another port to work.

Any chance it's related to fact I'm using step(1) approach (a 1 second timeout), and drive the Lua script from a C-based app?

SyRenity commented 9 years ago

My bad, the socket closed due to empty data being attempted to be sent.