|Re: [hatari-devel] Control socket server|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
On 05/01/2018 03:19 PM, Thorsten Otto wrote:
On Dienstag, 1. Mai 2018 13:29:50 CEST tin@xxxxxxxxx wrote:
I'm currently playing with this and it seems a bit of a hassle to have
every control application implementation set up a server (like e.g. the
I added control socket for Python-UI, so its requirements defined how
I separated Hconsole from it only couple of years later, when I started
to think that command line out-of-process control for Hatari would also
I once tried to implement something similar in Aranym, and also thought that
it would make more sense to implement the server in Hatari/Aranym rather than
in the script/whatever controlling it. However, when using the gui script,
this has several drawbacks:
- The script has to exec Hatari first, before it can connect to that socket
In case of Python GUI, it has to start Hatari itself, to make sure
Hatari is in a known state when the window is embedded.
- It then has to wait for Hatari to create the listener, and accept
connections to it
- Hatari itself then has to wait for the script to connect to that socket
before continuing, otherwise embedding the window into the gui does not work.
Yep, because of this it felt more natural to have the controlling
process be the server.
That whole sequence is thus much more complicated, and not very reliable. You
also have to use timeouts at several places, in case one of the steps goes
I think the proper solution would be to write the listener as a separate
program, and have both Hatari and the gui connect to it. But that requires lot
Then all the control processes would need to start two things, listener
(if it's not running yet), and Hatari. In would need to make sure it
gets connection to right Hatari instance that's connected to listener.
IMHO not really simpler.