简体   繁体   English

在同一应用程序中使用 IPv6 和 IPv4

[英]using IPv6 and IPv4 at the same application

I have a SNMP Manager written in C++ using the MG Soft SDK.我有一个使用 MG Soft SDK 用 C++ 编写的 SNMP 管理器。 Till now it only sends Get and receives Trap with IPv4.到目前为止,它只使用 IPv4 发送 Get 和接收 Trap。 Now a second SNMP Agent shall be connected but this one has IPv6.现在应连接第二个 SNMP 代理,但这个代理具有 IPv6。 Is it possible with one application to get a connection to one remote system with IPv4 and to another one with IPv6 at the same time with the same networkcard?一个应用程序是否可以使用同一个网卡同时连接到一个使用 IPv4 的远程系统和另一个使用 IPv6 的远程系统? or do I need 2 networkcards, one for IPv4 and the other for IPv6?还是我需要 2 个网卡,一个用于 IPv4,另一个用于 IPv6?

Yes, it is possible.对的,这是可能的。 You just need to open 2 separate connections from within your application - one using IPv4, the other using IPv6 (of course this requires you to implement support for both IPv4 and IPv6 protocols in your application).您只需要在应用程序中打开 2 个单独的连接 - 一个使用 IPv4,另一个使用 IPv6(当然这需要您在应用程序中实现对 IPv4 和 IPv6 协议的支持)。

It works the same way as if you wanted to open multiple IPv4 connections from within the same application.它的工作方式与您想从同一个应用程序中打开多个 IPv4 连接的方式相同。

For instace, web browsers open separate connections for separate webpages you visit.例如,web 浏览器为您访问的单独网页打开单独的连接。 They, of course, can connect to one web server using IPv4, while at the same time being connected to another web server via IPv6.他们当然可以使用 IPv4 连接到一台 web 服务器,同时通过 IPv6 连接到另一台 web 服务器。

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

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