wasi-sockets icon indicating copy to clipboard operation
wasi-sockets copied to clipboard

Should wasi-sockets have an opinion about broadcast?

Open jeffparsons opened this issue 1 year ago • 2 comments

Also, multicast?

I originally raised this question here: https://github.com/bytecodealliance/wasmtime/pull/7148#issuecomment-1747943612

In brief, I'm wondering if it's intended for wasi-sockets to have any special knowledge of UDP broadcast, or if they should be handled implicitly the same way all other restrictions on target addresses are.

If the answer is "it's all just UDP, so we do what UDP does and don't add any weird extras to the API" then would it be worth explicitly drawing attention to this in the spec? E.g. "if in doubt about how this API will behave, assume it is the same as the corresponding behaviour in Berkley sockets" or something?

Thanks! 💖

P.S.: I don't have any strong opinion about this — even about documenting it. I just thought just in case it hadn't been discussed that might be worth raising.

jeffparsons avatar Oct 09 '23 00:10 jeffparsons

Both broadcast and multicast require specialized socket options. None of which are currently specified or implemented, so implicitly they're unsupported. I agree it couldn't hurt to clarify this in the docs.

badeend avatar Oct 11 '23 14:10 badeend

Both broadcast and multicast require specialized socket options.

Oh! That makes sense, then. Despite having used it before, I somehow imagined that it was all handled implicitly using special addresses. Now I'm not sure where I got that idea.

Thanks for clarifying!

jeffparsons avatar Oct 11 '23 21:10 jeffparsons