lipp / lua-websockets

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

Question: Copas Receive #33

Open usysrc opened 10 years ago

usysrc commented 10 years ago

I hope you don't mind. This is more of a question than an issue. Do you know of any way to timeout the ws:receive() or whole sockets using copas and your lib? Maybe I'm missing something, I'm not sure.

lipp commented 10 years ago

For clients there is a limited support for copas timeouts. https://github.com/lipp/lua-websockets/blob/master/API.md#websocketclientcopas If you need more elaborate timeout control, I could provide a ws:settimeout() method.

lipp commented 10 years ago

@headchant is this sufficient for you?

usysrc commented 10 years ago

I think a ws:settimeout() would be what I need. Would it be possible to implement something like that?

lipp commented 10 years ago

this should be no problem. are you using websocket client or server?

usysrc commented 10 years ago

this would be for the websocket client