[haiku-development] restart app_server

  • From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 27 Dec 2011 09:42:50 +1300

Hi,

I just looked into how the app_server can be restarted, e.g. after a crash. The ability to restart the app_server could also be used to replace the app_server at runtime without a reboot. This can be handy if you developing app_server code... Here are my findings:

1. catch the app_server crash in the debug_server
2. restart the app_server
3. send a message to the registrar
4. in the registrar send a message to all apps to reconnect to the new app_server 5. in BApplication a new connection to the server is created and a remote ServerApp object is created (AS_CREATE_APP) 6. All BWindows as well as the window's top view are recreated on the server side.

(maybe better restart the app_server in the registrar in step 4.?)

This basically works as far as I could test it, there are only two more problems. The bigger problem is that I also have to handle BBitmaps but there is no list of all BBitmaps on client side. I need this list to connect all BBitmaps to the server again. My idea is to add a private locked BBitmap list. A little bit more overhead but I think this should be ok, right?

However, after reconnecting a BBitmap the content might be lost and I am not sure if it can be revived. The client clones the bitmap area thus it should still be there and could be reused (?). Does this also works if this area is mapped to a real graphics card?

Another problem is that I don't get keyboard and mouse input after a restart. Anybody knows how to make this working again or why it is not working?

thanks,
        Clemens

Other related posts: