RPC和C ++-需要一些基础知识 [英] RPC and C++ - need some basics

查看:58
本文介绍了RPC和C ++-需要一些基础知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用组件技术制作应用程序,并且希望在位于不同主机中的组件之间进行交互.我知道远程过程调用(RPC)的基础知识,是RPC还是一种简单的方法,还是有些朋友建议使用COM,对此我一无所知.

我想知道可用于将RPC与c ++一起使用的任何教程和书籍,我必须从位于一个组件中的类中的类从客户端的另一个组件中充当服务器,调用几种方法,我通过google找到了一些有趣的资料, MSDN和codeproject中RPC的介绍,但它们都没有提供服务器端访问对象的信息,谁能提出一些入门资料,


建议我一些好的方法来解决这个问题.

谢谢,
hari

Hi ,
I am making an application using component technology and i want to make the interactions between the components located in different hosts. I know the basics of Remote procedure calls(RPC) ,is RPC still an easy methods to do it or some friends suggested to use COM , i have no idea about that .

I would like to know any tutorials and book available for using RPC with c++, I have to invoke several methods from a class located in the one component acting as server from another component in the client , i found some interesting materials through google, tutorials in MSDN and introduction to RPC in codeproject also , but they all did not gave information on accessing objects in the server side , can any one suggest some starting materials ,


suggest me some good methods to work on this .

thanks ,
hari

推荐答案

这是一本有关RPC的好文章,其中列出了一些RPC类似物.您可以在每个参考文献上进行参考:
http://en.wikipedia.org/wiki/Remote_procedure_call [ http://en.wikipedia.org/wiki/Component_Object_Model [^ ],http://en.wikipedia.org/wiki/Distributed_Component_Object_Model [ ^ ])获得了最多的欢迎,并且已经建立了良好的声誉,但是他们的看法非常谨慎.

我可以看到COM似乎是Windows之类的非面向对象系统之间的过渡阶段(至少从API的角度来看;而且,尽管事实上API大多保持OOP风格,但从技术上讲,这不是OOP. )和面向对象的技术,例如与C ++相关的技术.这种措施无法治愈OS的非面向对象性质,因此创建了许多人工构造,并使系统变得肿.在我看来,COM应该可以使用,而基于CLR的系统应该可以取代Windows.微软已经朝着这个方向努力:


COM后来成为CLR和.NET的代名词,它是一种用来与旧版代码建立联系的胶水.但是.NET自上而下是一个真正的面向对象的系统,它根本不需要COM.我真正希望推荐的是经典的.NET远程处理(很多人说它已经过时了,但是我不太确定)和WCF.问题是:如果考虑到这一点,则应考虑使用C ++/CLI或C#,而不是C ++.虽然C ++/CLI与C ++非常接近,但本质上有所不同.如果您有兴趣,请参见:

http://en.wikipedia.org/wiki/.NET_Remoting [ http://msdn.microsoft.com/en-us/library/2e7z38xb%28v = VS.100%29.aspx [ ^ ],
http://en.wikipedia.org/wiki/Windows_Communication_Foundation [ http://msdn.microsoft.com/en-us/netframework/aa663324.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/dd456779.aspx [ ^ ],
http://en.wikipedia.org/wiki/C%2B%2B/CLI [ ^ ],
http://en.wikipedia.org/wiki/C%2B%2B/CLI [ ^ ],
http://www.ecma-international.org/publications/standards/Ecma-372.htm [ ^ ].

补充:


要了解如何在OS开发中使用托管CLR平台,请阅读以下项目:

微软奇点:
http://en.wikipedia.org/wiki/Singularity_%28operating_system%29 [ ^ ],
http://research.microsoft.com/en-us/projects/singularity/ [ ^ ];

宇宙:
http://en.wikipedia.org/wiki/Cosmos_%28operating_system%29 [ ^ ],
http://cosmos.codeplex.com/ [ ^ ];

SharpOS:
http://en.wikipedia.org/wiki/SharpOS_%28operating_system%29 [ ^ ],
http://www.sharpos.org/ [ ^ ];

苏黎世联邦理工学院(ETH Zurich)— Microsoft Research Barrelfish:
http://en.wikipedia.org/wiki/Barrelfish [ http://www.barrelfish.org/ [ ^ ].

Microsoft Midori(代号):
http://en.wikipedia.org/wiki/Midori_%28operating_system%29 [ ^ ].

—SA
This is a good article on RPC where some RPC analogues are listed; you can follow a reference on each of them:
http://en.wikipedia.org/wiki/Remote_procedure_call[^].

My own opinion? Hard to say. I think, in the words of C++ and Windows, COM and DCOM (http://en.wikipedia.org/wiki/Component_Object_Model[^], http://en.wikipedia.org/wiki/Distributed_Component_Object_Model[^]) got the most of popularity and are well established, but view of them is very cautious.

I could see that COM appeared as a transitional stage between such non-object-oriented system as Windows (at least from the API point of view; and, despite the fact that the APIs are mostly kept in OOP style, technically this is not OOP at all) and object-oriented technologies, such as those related to C++. This measure could not cure non-object-oriented nature of OS and created a number of artificial constructs and made the system considerably bloated. In my string opinion, COM should go, and CLR-based systems should replace Windows. Microsoft is already working in this direction:


COM later made its way to the word of CLR and .NET, as a glue used to create a bond with legacy code; but .NET is a truly object-oriented system, top to bottom, it does not need COM at all. What I really would prefer to recommend, is either classical .NET remoting (many say it is obsolete, but I''m not so sure) and WCF. The problem is: if you consider this, you should consider C++/CLI or C#, not C++. C++/CLI is very close to C++ though, but essentially different. If you are interested, see also:

http://en.wikipedia.org/wiki/.NET_Remoting[^],
http://msdn.microsoft.com/en-us/library/2e7z38xb%28v=VS.100%29.aspx[^],
http://en.wikipedia.org/wiki/Windows_Communication_Foundation[^],
http://msdn.microsoft.com/en-us/netframework/aa663324.aspx[^],
http://msdn.microsoft.com/en-us/library/dd456779.aspx[^],
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^].

Supplement:


To get an idea of how managed CLR platform can be used in development of OS, please read about the following projects:

Microsoft Singularity:
http://en.wikipedia.org/wiki/Singularity_%28operating_system%29[^],
http://research.microsoft.com/en-us/projects/singularity/[^];

Cosmos:
http://en.wikipedia.org/wiki/Cosmos_%28operating_system%29[^],
http://cosmos.codeplex.com/[^];

SharpOS:
http://en.wikipedia.org/wiki/SharpOS_%28operating_system%29[^],
http://www.sharpos.org/[^];

ETH Zurich — Microsoft Research Barrelfish:
http://en.wikipedia.org/wiki/Barrelfish[^],
http://www.barrelfish.org/[^].

Microsoft Midori (code name):
http://en.wikipedia.org/wiki/Midori_%28operating_system%29[^].

—SA


这篇关于RPC和C ++-需要一些基础知识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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