net
net copied to clipboard
add support for connected UDP sockets
Fixes #36.
TODO:
- [ ] agree on the API (see discussion on #36)
- [ ] add test case
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.
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.