IPC机制在C ++&目标C. [英] IPC Mechanism to communicate between C++ & Objective C

查看:265
本文介绍了IPC机制在C ++&目标C.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Mac应用程序,其中我需要实现IPC机制。方案是这样的:

I'm developing a Mac Application in which i need to implement IPC Mechanism. The Scenario is this :

我的应用程序包含两个可执行文件,一个是Native Mac App(NSStatusItem应用程序),另一个是在CPP上编码的终端应用程序。我想在这两个进程之间建立IPC通信。

My Application contains two executables, one is Native Mac App(NSStatusItem app) and other is a terminal app coded on CPP. I want to establish IPC Communication between these two processes. I want to be able to send and recieve messages both from CPP to Objective C and vice versa.

哪个IPC机制会更好地适应这种情况?我想要能够从CPP向目标C发送和接收消息。

Which IPC Mechanism would better suit this ?

此外,这个wiki(http://en.wikipedia.org/wiki/Inter-process_communication#Main_IPC_methods)显示,IPC命名管道在POSIX和Windows中支持。我想澄清一下,如果我使用命名管道(我知道它的单向),是否支持在Mac和目标C ..?

Also this wiki(http://en.wikipedia.org/wiki/Inter-process_communication#Main_IPC_methods) Shows, IPC Named Pipes are supported in POSIX and Windows. I wanted to clarify that if i'm using Named Pipes(i know its unidirectional), is it supported in Mac and Objective C ..?

[PS:If Possible ,请提供示例代码或链接到IPC在C ++&目标C)。

[P.S : If Possible, Please provide example code or links to IPC in C++ & Objective C).

推荐答案

Unix域套接字是伟大的。 http://www.cs.cf.ac.uk/Dave/C /node28.html

Unix domain sockets are Great for this. http://www.cs.cf.ac.uk/Dave/C/node28.html

这篇关于IPC机制在C ++&目标C.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆