lipp / lua-websockets

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

Set socket timeout to opts.timeout or 1 -- to prevent constant reads #82

Closed OptimusLime closed 8 years ago

OptimusLime commented 8 years ago

Defaults to 1 ms timeout (to prevent continuous reading on the socket even if no information is available). Added an option "timeout" in case there are event less requirements for socket performance speed.

Previously, the defaults were 0 and the socket would eat all my CPU when using chrome.

lipp commented 8 years ago

@OptimusLime This has two problems:

maybe your app logic drives chrome or your lua process busy? the lua-ev implementation is running on many products (where i work) and no performance issues so far.