[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fluid-dev] Stopping fluidsynth via a socket
From: |
John O'Hagan |
Subject: |
Re: [fluid-dev] Stopping fluidsynth via a socket |
Date: |
Sun, 30 Jan 2011 03:08:15 +0000 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-2011-01-16-16.13; KDE/4.4.5; i686; ; ) |
On Sat, 29 Jan 2011, Matt Giuca wrote:
[...]
>
> So it seems like when you use Fluid's network interface, it *doesn't* quit
> * itself*. It closes the socket. This seems sensible to me. FluidSynth is
> acting as a network service. It's giving the client the illusion of being
> at a FluidSynth console, and if the client wants to log out, they type
> "quit". It wouldn't make sense for the client to be able to shut down the
> network service, any more than a web browser can kill a web server by
> closing the browser window. So I think FS is behaving correctly and
> sensibly and I wouldn't imagine there was a way to remotely shut down the
> server (though I may be wrong about that).
>
> It makes sense, though, in your situation, to want to do that, since you
> are the one that started it in the first place (with subprocess). So, I
> guess I would ask why you are using sockets at all, instead of using the
> subprocess stdin socket? (Obviously, without the -i argument). Then it
> will close when you quit, as you say. Alternatively, if you need to use
> sockets, just detect when the socket closes (as Fluid will automatically
> close your socket when you "quit"), and then call the
> terminate<http://docs.python.org/library/subprocess.html#subprocess.Popen.t
> erminate>method on the Popen object returned by subprocess.Popen.
>
> Hope one of these suggestions helps
> Matt
That makes perfect sense, thanks.
John