daurnimator / lua-http

HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.
https://daurnimator.github.io/lua-http/
MIT License
778 stars 80 forks source link

Closing a websocket in one coroutine throws error in other coroutine #182

Closed jprjr closed 3 years ago

jprjr commented 3 years ago

Hi there, I think this is related to cqueues https://github.com/wahern/cqueues/issues/9

I have an application where I'm reading from a websocket in a coroutine, and I want to close the connection down from another.

I thought the websocket would return nil, closed or something along those lines, it winds up throwing an error: calling recv on bad self (socket closed)

daurnimator commented 3 years ago

Could you come up with a minimized test-case?

jprjr commented 3 years ago

I'm so sorry, the error was actually elsewhere (handling a UDP connection), I'll close this.