Python 3.10 - module 'socket' has no attribute 'IPPROTO_MPTCP'

500 Views Asked by At

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

1

There are 1 best solutions below

0
On

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.