I have several apps that use helper apps and pipe data back and forth either through a real pipe like a TCP socket or a chunk of shared memory. What you want to do as far as handing things off depends entirely on where the input to the helpers is coming from and where it ultimately needs to go.
As far as shared memory is concerned, I’ve used that only for background apps that are processing really large amounts of data. In my case they were HD images from web cams. But that also takes a lot of memory to have locked and not able to be moved around by the system. And I still needed commands in a queue over the socket to tell the watchers of that image that the next image was ready and waiting for them to read out of shared memory. It will also only work as long as the sender and receiver are on the same machine.
I originally implemented that shared memory approach because there was a “bug” or possibly just limitation ;) With older versions of Xojo where a server socket read was limited to 8k, so you had to get a LOT of data available events to receive an HD image and each one required a trip through the event loop and so it was very slow. This has been fixed for a while now and my next version of that software will eliminate the shared memory solution as it isn’t noticeably faster than just piping the data through a TCP socket but is very much more complicated.
If you have clear network access between the client and the helper app then the main app can just setup the communications between the 2 directly. You can’t pass off a socket but you can tell the helper app to open another listening socket and then also tell the client to connect on that socket to continue the conversation. That eliminates the middle man after the initial connection is made. This works great as long as the 2 processes are running where they can reach each other without having to worry about peoples cable modems and NAT passthroughs and such, and doesn’t work at all if you are working in such a distributed environment or if the firewall policies won’t allow you to open a range of ports to use for that sort of communication. The main app would be strictly for load balancing between the helper apps in that case.
Again though, like shared memory, that only makes a difference if you’re sending a HUGE amount of data back and forth. Just establishing the connection is a very slow process, once you have the connection in place sending data around is very fast. So if you’re not sending hundreds of k or even megs back and forth it’s not going to be any faster to do all that work than just to forward it through the main app.