Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6362157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:52:22+00:00 2026-05-24T23:52:22+00:00

I want to implement IPC in a Cocoa application using UNIX domain sockets, with

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:52:23+00:00Added an answer on May 24, 2026 at 11:52 pm

    In the end, I did use UNIX domain sockets, and they work pretty well. I have launchd set up the socket for my server (but did write code, successfully, to create it myself), and have the client connect to it.

    Things I learned:

    • You can wrap both ends of the connection in NSFileHandle

    • You do need to use connect() on the client side to create a connection to the socket

    • You should make both the client and the server ignore SIGPIPE

    • If you get called back with zero-length data, it means that the thing on the other end of the socket has disconnected (i.e. the server/client exited). Make sure to close and release your end of the socket in this case — don’t try to read data from it again, or just get another zero-length read callback (for ever and ever)

    • You’re responsible for delimiting and assembling the messages you send across the socket (a single message sent on one end may be spit into more than one on the other end, or multiple messages might be merged)

    I would be happy to share or publish code, just haven’t had the time to clean it up for public consumption. If anyone is interested, let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement an automatic update system for a windows application. Right now
I want to implement an ISAPI filter like feature using HttpModule in IIS7 running
I want to implement a simple debug log, which consists of a table into
i have question for example i want to implement binary tree with array i
I want to implement the replication and fault tolerance in CORBA using Java. I
I want to implement file upload in RESTful way using openrasta but not able
I want to implement Single Sign-on in a customer's application. The customer has hosted
I have a little Android project going on which involves some IPC where client
I need add paging to panel, which populated with dynamically-created controls. I want implement
I want to implement UITableView Where I want to have 3 buttons in each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.