IPC建议 [英] IPC advice

查看:90
本文介绍了IPC建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我的应用程序在同一台机器上的2个进程中运行。现在我需要从一个进程向另一个进程发送一个

字符串。一个进程是托管的,另一个是本机的。

通信应该在任何计算机上工作(即使有防火墙)

我可以在一个进程中写入文件并在其他进程中读取它但是它似乎是

糟糕的解决方案。

有人可以就简单快速的解决方案向我提出建议。

非常感谢。

Dear all,
my application runs in 2 processes on the same machine. Now I need to send a
string from one process to another. One process is managed other is native.
The communication should work on any computer (even with firewalls)
I could write file in one process and read it in other but it seems to be
bad solution.
Could somebody advice me about the simple and fast solution.
Thanks a lot.

推荐答案

>亲爱的,
我的应用程序在同一台机器上的2个进程中运行。现在我需要从一个进程发送一个
字符串到另一个进程。一个进程是托管的,另一个是本机的。
通信应该可以在任何计算机上运行(即使有防火墙)
我可以在一个进程中编写文件并在其他计算机中读取但是它似乎很糟糕解决方案。
有人可以就简单快速的解决方案向我提出建议。
非常感谢。
my application runs in 2 processes on the same machine. Now I need to send a
string from one process to another. One process is managed other is native.
The communication should work on any computer (even with firewalls)
I could write file in one process and read it in other but it seems to be
bad solution.
Could somebody advice me about the simple and fast solution.
Thanks a lot.




如果必须在不同的计算机上工作,无论防火墙设置如何,

最好的选择是使用TCP套接字。

一个进程充当服务器并允许特定的传入连接

端口。另一个进程连接。

然后他们可以互相发送数据。


过去我曾经使用过winsock(这是非托管的) windows

服务,而且效果很好。这样,不同的计算机甚至不需要运行相同的操作系统。 UNIX和Windows可以一起工作,而不会出现任何问题。


您可以在非托管应用程序中使用winsock,在托管应用程序中使用TcpChannel。 />
对于非托管你也可以使用MFC类,但是我从来没有使用过

那些。


-


亲切的问候,

布鲁诺。
br ********************** @ hotmail.com

仅删除_nos_pam



If it has to work on different computers, regardless of firewall settings,
the best option is to use TCP sockets.
one process acts as a server and allows an incoming connection on a specific
port. the other process connects.
Then they can send data to each other.

I have used winsock (which is unmanaged) in the past like this in a windows
service, and it worked great. this way the different computers don''t even
have to run the same OS. UNIX and windows can work together that way without
any problem.

You can use winsock in your unmanaged app, and TcpChannel in your managed app.
For unmanaged you can probably also use MFC classes, but i''ve never used
those.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"


亲爱的布鲁诺,

它不必在不同的计算机上运行,​​两个部分总是运行在

同一台PC。有没有更好的选择,或者你仍然建议使用套接字?

非常感谢,
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use sockets?
Thanks a lot,


字符串总是大小相同,不是太大了?如果是,您可以使用共享段实现具有共享段的DLL。这是迄今为止最快的选择,

,因为这两个进程实际上会共享相同的物理内存。


" Boni" <无**** @ parampam.pam>写在消息

新闻:%2 **************** @ TK2MSFTNGP14.phx.gbl ...
Is the string always of the same size and not too big? If yes, you could
implement a DLL with a shared segment. This is by far the fastest option,
because both processes would effectively share the same physical memory.


"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
亲爱的布鲁诺,
它不必在不同的计算机上工作,两个部分总是在同一台PC上运行。有没有更好的选择,或者你还建议使用
套接字?
非常感谢,
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,



这篇关于IPC建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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