net icon indicating copy to clipboard operation
net copied to clipboard

add support for connected UDP sockets

Open marten-seemann opened this issue 1 year ago • 2 comments

Fixes #36.

TODO:

  • [ ] agree on the API (see discussion on #36)
  • [ ] add test case

marten-seemann avatar May 17 '24 05:05 marten-seemann

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 avatar May 17 '24 15:05 marten-seemann

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.

marten-seemann avatar May 19 '24 03:05 marten-seemann