小编Lis*_*ins的帖子

rpc 和普通 tcp/udp 服务器客户端程序的区别?

所以我一直在寻找不同的方法来创建客户端和服务器程序(使用 c++ 中的 Visual Studios),我遇到了 RPC(远程过程调用)。但我注意到这也使用了 tcp/ip 或 udp 连接。

那么使用 RPC 与仅使用基本的 tcp/ip 或 udp 连接来连接客户端和服务器有什么区别?

代码完全不同,例如在 RCP 中使用 tcp:

      reinterpret_cast<unsigned char*>("ncacn_ip_tcp"), // Use TCP/IP protocol.
      reinterpret_cast<unsigned char*>("localhost"), // TCP/IP network address to use.
      reinterpret_cast<unsigned char*>("4747"), // TCP/IP port to use.
Run Code Online (Sandbox Code Playgroud)

但是在其他程序中(例如使用 WinSock)它需要更多的代码,一个比另一个更好吗?

c++ rpc udp tcp client-server

4
推荐指数
1
解决办法
5682
查看次数

标签 统计

c++ ×1

client-server ×1

rpc ×1

tcp ×1

udp ×1