boost.asio 是否可以使用链接本地地址绑定到特定的网卡?

发布于 2024-12-18 10:17:53 字数 222 浏览 3 评论 0原文

由于 asio 文档并不真正名副其实,我不得不问这个问题。帮助我 Stackoverflow,你是我唯一的希望;)

我们在这里谈论 IPv6。我想告诉 asio 使用特定的接口,例如 eth0,但没有全局 IP 地址,因为我只链接本地接口。 我想要一些类似于 ping6 -I 的东西。 这可以用 asio 实现吗?还是我必须使用 Berkeley Sockets?

预先感谢您并致以最诚挚的问候。

as the asio documentation does not really live up to its name I have to ask this question. Help me Stackoverflow, you are my only hope ;)

We are talking in IPv6 here. I would like to tell asio to use a specific interface, like eth0, but without a global ip address, since I have only link local ones.
I would like to have something simliar to ping6 -I .
Is this possible with asio or do I have to use Berkeley Sockets for this?

Thank you in advance and best regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绾颜 2024-12-25 10:17:53

在 IP 地址后面附加接口名称,并使用

fe80::15c3:6bea:aaac:a016%eth0

取自此答案% 分隔符。

append the interface name after the IP address with a % delimiter

fe80::15c3:6bea:aaac:a016%eth0

taken from this answer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文