[unix] multicast socket recvfrom() address format #15595
Unanswered
fmafma
asked this question in
Unix & Windows
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
As explain in another thread, on the unix port, the address returned by
recvfrom()
socket method is in the raw form (16 bytes).A friend explained me it matches the C struct:
In practice, this is an union, depending on the familly. For IPv4:
In my case, I get the raw data
\x02\x00\x0e\x57\xc0\xa8\x00\x92\x00\x00\x00\x00\x00\x00\x00\x00
which matches('192.168.0.146', 3671)
.The question is: why the raw data isn't converted in a more useful tuple
(ip, port)
under the unix port, while it is on the rp2 port, for example, and on CPython? Is it a bug? A feature?Thanks,
Frédéric
Beta Was this translation helpful? Give feedback.
All reactions