Reputation: 300
Sorry in advance if this is an obvious question or I demonstrate a total lack of knowledge here (which would be accurate).
We're interacting with a C API. That API stores all sorts of session/environment information under the hood. There are specific API calls that require a total restart of the API, but the only way to accomplish that is fully shutting down the client application that invokes it (the API acts like a Singleton with no way to reinitialize itself).
My hope is that potentially wrapping the C API in an XPC Service would let me more gracefully shut down the service and restart it so I can avoid restarting the entire client application.
Any direction / ideas / critiques most welcome
Thank you!
Upvotes: 0
Views: 283
Reputation: 300
I think I got this to work with NSXPCConnection.
Following up on Kill XPC when parent app is still running I called what I could of the API's dispose-ish methods and then called exit(0)
inside of a method in the the XPC connection.
So far, so good!
Upvotes: 0