Python 3.10 - 模块“socket”没有属性“IPPROTO_MPTCP”;

发布于 2025-01-13 18:18:52 字数 449 浏览 0 评论 0原文

根据文档,Python3中已经添加了“IPPROTO_MPTCP”协议。 10,但是当我创建这样的套接字时,

socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_MPTCP)

我收到此错误

module 'socket' has no attribute 'IPPROTO_MPTCP'

我可能做错了什么?这是一个屏幕截图。

这里还有一个屏幕截图

According to the documentation, the "IPPROTO_MPTCP" protocol has been added to Python3.10, but when I create a socket like this,

socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_MPTCP)

I get this error

module 'socket' has no attribute 'IPPROTO_MPTCP'

What could I be doing wrong in this? Here's a screenshot.

Here's a screenshot as well

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

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

发布评论

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

评论(1

弱骨蛰伏 2025-01-20 18:18:52

就像 @Boris Verkhovskiy 猜测的那样,目前 Python 需要使用 IPPROTO_MPTCP 选项进行编译。您可以通过转到变更日志,然后打开票证来查看这一点,您可以检查 diff

如果您使用的是 Linux,请同时检查您的内核版本 (>= 5.6) 和是否启用 MPTCP (sysctl net.mptcp.enabled)。查看此清单了解更多详细信息。

Like @Boris Verkhovskiy guessed, for now Python needs to be compiled with the IPPROTO_MPTCP option. You can see that by going to the changelog, then opening the ticket, you can check the diff

If you are on linux, please also check your kernel version (>= 5.6) and whether MPTCP is enabled (sysctl net.mptcp.enabled). Check this checklist for more details.

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