UNIX Domain Sockets and Cocoa

2009-06-13T06:24:41

I want to implement IPC in a Cocoa application using UNIX domain sockets, with which I have no experience. I found Apple's CFLocalServer example project, but it's written in C and looks, well, fairly complicated (and yes, I have read most of it).

Are the techniques demonstrated in CFLocalServer still state-of-the-art, or is there a way to implement UNIX domain sockets in Objective-C with Cocoa/Foundation?

I'm playing with NSSocketPorts and NSFileHandles (which provide a healthy amount of abstraction, which is great for this project) and found some very-related code in Mike Bean's Networking in Cocoa, but haven't been able to Make It All Work yet.

Anyone done this before?

Copyright License:
Author:「s4y」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/989346/unix-domain-sockets-and-cocoa

About “UNIX Domain Sockets and Cocoa” questions

I want to implement IPC in a Cocoa application using UNIX domain sockets, with which I have no experience. I found Apple's CFLocalServer example project, but it's written in C and looks, well, fai...
I am planning to use unix domain sockets for my IPC (inter process communication) between two processes running on same host machine. But I have to look into data security also before choosing unix
The example code listed here shows how to make warp listen only on specific hosts. Furtheremore, this post shows some basics on how to use unix domain sockets in Haskell. How can I combine those ...
Just to make sure sure, one can call select on a Unix Domain socket. Correct? Also one can mix different types of sockets in a select statement. Is that correct?
I want to have a local server in Unix to handle concurrent requests, if it's possible, and whose response would be in binary format. Are the Unix domain sockets right for this task?
Oddly I didn't find this info by googling. What is the cost of establishing connection using Unix Domain sockets versus TCP sockets? Right now I have to do connection pooling with TCP sockets beca...
My requirement is to make RPC calls between different processes. By nature these calls are 1-1; meaning single sender single receiver. I am architecturally restricted to use only unix domain socket...
I need to set up some relatively simple IPC for Mac and it needs to be done using UNIX domain sockets. I'm brand new to Swift so while I know this is possible I'm struggling even create my client and
Keep-alive works just fine over TCP. But Unix Domain Sockets gives me weird behavior. If I send a couple thousand requests like this: request.post('http://unix:/tmp/http.sock:/check', { json: { ...
This question is NOT for the difference between STREAM type and DATAGRAM type INTERNET sockets. I know that STREAM sockets use TCP, Datagram sockets use UDP and all the TCP,UDP stuff, packets arriv...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.