stockfish.js
stockfish.js copied to clipboard
Stockfish 16 does not respond to the "quit" command
It seems that the new 16th version of Stockfish does not respond to the "quit" command. When sending stockfish.postMessage("quit") - it continues to send analytics. Whereas the 15th version returns a status of 0 - successful termination of work - in the console.
@saynschuman, can you confirm which flavor of the engine you are using? The multi-threaded engine seems to exit properly.
You may want to run the engine in a Web Worker so that you can terminate the Worker.
I run it like this on the web - stockfish = new Worker(/js/sf15/stockfish.js); stockfish.onmessage = (event: MessageEvent) => {} then I listen for its responses. So, the response stockfish.postMessage("quit") does not work as expected in version 16. I also observe this in version 11. It works fine in version 15. Here's the archive with JS wrapper files of all the versions I use js.zip