Open cvuchener opened 10 months ago
I have several ideas, none seems simple:
SimpleSocket::Close
to interrupt the connection thread. Not very clean and SimpleSocket::Close
is not thread-safe because of the internal buffer and error handling. Making it thread-safe will likely require an API change.What is the scope of clsocket? I see it used in RemoteServer/RemoteClient and the luasocket plugin. Is it used outside of this repository?
I fell into a rabbit hole.
My understanding is that the detached connection thread blocks in
recv
. When the client finally tries to send something, the thread is unblocked and will terminate because of an error orBlockGuard
throwing.Solving this would require a way to wake up the connection threads when quitting, but I don't find such mechanism in clsocket.