简体   繁体   English

使用C ++进行网络编程

[英]Network programming using C++

How can we do network programming in C++ similar to Remoting in .NET? 我们如何在C ++中进行网络编程,类似于.NET中的Remoting? Please help with any tutorials. 请帮助任何教程。

It would be fine if I know how to enable two computers to communicate in the form of sending and receiving messages using C++/C#. 如果我知道如何使两台计算机能够使用C ++ / C#以发送和接收消息的形式进行通信,那将是很好的。

Thanks, Rakesh. 谢谢,拉克什。

For windows, you can check out this . 对于Windows,您可以签出this You could refer Beej's guide for Unix flavors. 您可以参考Beej的 Unix风格指南

C++ does not have any native networking libraries, so if you don't want to use OS specific calls, you are going to need to use a portability layer. C ++没有任何本地网络库,因此,如果您不想使用特定于操作系统的调用,则需要使用可移植性层。

Two that come to mind are Boost ASIO and ACE . 想到的两个是Boost ASIOACE

You may want to have a look at the Poco C++ libraries. 您可能想看看Poco C ++库。 Especially the Net module. 特别是Net模块。

For a pure C++ solution (as your first sentence suggests) that's also really simple to use, checkout RCF . 对于纯C ++解决方案(正如您的第一句话所暗示的那样),它也非常易于使用,请签出RCF

If you want to communicate between C# and C++ programs (as your second sentence suggests) you'll have to look elsewhere, sorry. 如果您想在C#和C ++程序之间进行通信(如第二句话所示),那么您将不得不在别处查找,抱歉。

Check out our C++ Remoting framework . 查看我们的C ++ Remoting框架 There's also a screencast showing how to use it. 还有一个截屏视频,显示如何使用它。

This is probably the closest that you'll get to .NET Remoting in C++. 这可能是您在C ++中最接近.NET Remoting的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM