DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.86k stars 471 forks source link

Dwarf Fortress hangs when quitting while a client is connected to DFHack server #4044

Open cvuchener opened 10 months ago

cvuchener commented 10 months ago

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 or BlockGuard throwing.

Solving this would require a way to wake up the connection threads when quitting, but I don't find such mechanism in clsocket.

cvuchener commented 10 months ago

I have several ideas, none seems simple:

What is the scope of clsocket? I see it used in RemoteServer/RemoteClient and the luasocket plugin. Is it used outside of this repository?