dispatchrun / net

Go package implementing WASI socket extensions
Apache License 2.0
137 stars 7 forks source link

add support for connected UDP sockets #35

Open marten-seemann opened 3 months ago

marten-seemann commented 3 months ago

Fixes #36.

TODO:

marten-seemann commented 3 months ago

For some reason this only works for localhost, but not for other addresses. This is not very useful... I'll need to dig into what's going on here.

marten-seemann commented 3 months ago

For some reason this only works for localhost, but not for other addresses. This is not very useful... I'll need to dig into what's going on here.

After some more debugging, here's what's going on:

wasip1.DialUDP("udp", "127.0.0.1:1234", "8.8.8.8:1234")

fails, whereas

wasip1.DialUDP("udp", "0.0.0.0:1234", "8.8.8.8:1234")

succeeds.

I think this makes sense, since 8.8.8.8 is actually not available on the lo interface. You need to send from a different interface.