During UDP communication
OSError: [Errno 40] Message too long
I was in trouble because of the error, so I will post it so that I do not forget the remedy.
sysctl -a | grep udp.maxdgram
When you execute, the packet capacity for udp communication is displayed.
net.inet.udp.maxdgram: 9216
I solved it by changing this value.
sudo sysctl -w net.inet.udp.maxdgram=65536
Actually, at this time, even if I sent the data of size 65536 with Python, an error still occurred, so I made the data a little smaller and sent it. Is it sent with some extra information added ... I would be grateful if anyone could tell me something.