>I would be all in favour for adding a new command that actually terminates the whole of FluidSynth. “shutdown” might be an appropriate name. :-) It seems that this "shutdown" command simply should only terminate the server (and consequently close all client connection) ?
envoyé : 7 mars 2022 à 00:19 de : Marcus Weseloh <mar...@weseloh.cc> à : FluidSynth mailing list <fluid-dev@nongnu.org> Cc: Ben Gonzales <b...@gonzos.net> objet : Re: [fluid-dev] Failure to bind server socket: 98
Am So., 6. März 2022 um 23:34 Uhr schrieb Marcus Weseloh <mar...@weseloh.cc>: I just tried it with 2.2.1 and got the same result: when I type "quit", FluidSynth doesn't exit but waits for the accept() to return. And I don't see any ifdefs for WIN32 around this call... really weird. Is Windows handling thread joining differently and actually terminates a thread blocking in IO when calling fluid_thread_join()?
Hm... I have the feeling we are relying on undefined POSIX behaviour here. Calling close() on a socket from one thread that another thread is blocking on in accept() does not necessarily cause the accept() to return. At least my system doesn't. The interactive shell command "quit" calls fluid_socket_close() on the client->socket, then joins the client thread. On systems where close() interrupts an accept() it seems to works fine. But not on my system... If I add an explicit shutdown(client->socket, SHUT_RDWR) before the socket_close(), then accept is also interrupted. Mind you, calling close on another threads socket seems to be discouraged anyway.
Sorry Ben for hijacking your thread, I'll create an issue on GitHub for this problem.
So... so answer your real question: I would be all in favour for adding a new command that actually terminates the whole of FluidSynth. "shutdown" might be an appropriate name. :-)
Cheers Marcus
_______________________________________________ fluid-dev mailing list fluid-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/fluid-dev
|
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev