jsonrpc
jsonrpc copied to clipboard
Avoid errors when shutting down
This tries to prevent signaling errors when the server is shut down or a client disconnects. Such errors can come from (1) trying to interrupt a thread that has already exited, (2) a background thread trying to read from a closed stream, or (3) a background thread trying to write to a closed stream.