C++ backend with Swift / Obj C frontend

Hi all,

We have developed a C++ framework which runs in its own thread in an endless loop and which has, among many others, the ability to act as either TCP server or client. This framework is used in Android and Windows as a backend and has the ability to send information towards the front-end based on external triggers. I found that it is possible to call C++ functions from within objective C, but I can't seem to find whether it is possible to start a C++ backend in an endless loop as well and have all control (incl. sending messages towards the front-end, opening TCP sockets, ...)?

Thanks for the advice!

Yes, that should work.

I can't seem to find whether it is possible to start a C++ backend in an endless loop as well

The standard approach here is to start a thread and have it run your main work loop. The exact mechanics of that depend on the abstraction layers that your C++ already uses for its work loop.

and have all control (incl. sending messages towards the front-end, opening TCP sockets, ...)?

It’s certainly possible to pass messages between threads although, again, the best approach depends on what your existing code is using for its event sources.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

C++ backend with Swift / Obj C frontend
 
 
Q