Re: Talking to other apps
Re: Talking to other apps
- Subject: Re: Talking to other apps
- From: Jens Alfke <email@hidden>
- Date: Mon, 04 Aug 2014 10:56:42 -0700
> On Aug 4, 2014, at 10:41 AM, Scott Ribe <email@hidden> wrote:
>
> Showing my age here, but as an old UNIX troll, and assuming the apps are not sandboxed, I'd just use domain sockets.
>
> <https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man4/unix.4.html>
I have done this, and it’s surprisingly painful. I’d never do it again.
_Using_ the sockets is pretty easy (assuming you enjoy implementing framing protocols). The hard part is that you have to have a pseudo-file, located in the filesystem, to represent a Unix-domain socket. So you have to find a hidden place to create this ‘file’ with a randomly-chosen name (unless you don’t care about DoS attacks), give it the proper permissions, somehow transmit knowledge of that location to the other app, and clean it up when you’re done.
Doing this instead of using XPC or AppleEvents is like carving your own wheel out of stone instead of just going to a store and buying one.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden