Closed manekinekko closed 10 months ago
In that example, the line above it calls Connect, which performs an implicit bind. This is [standard POSIX behavior](https://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html#:~:text=If%20the%20socket%20has%20not%20already%20been%20bound%20to%20a%20local%20address%2C%20connect()%20shall%20bind%20it%20to%20an%20address%20which%2C%20unless%20the%20socket%27s%20address%20family%20is%20AF_UNIX%2C%20is%20an%20unused%20local%20address.):
If the socket has not already been bound to a local address, connect() shall bind it to an address which (...) is an unused local address.
I'd say the test case is correct and the WIT file could use a clarification.
Gotcha! That's what I assumed as well. Thank you for clarifying that.
Closing this issue (for implementation progress see https://github.com/bytecodealliance/jco/issues/154)
BTW, the same applies to accept
'ed client sockets
Great! Will update the impl. Thanks.
Hi, I am currently implementing wasi-sockets for jco, and I am encountering an unspecificed behavior.
The
test_tcp_connect_dual_stack
test inside of the test programm preview2_tcp_connect.rs, creates av6_client
socket that connects to thev4_listener
socket. In the following line, we are accessingv6_client.local_address()
that is supposed to throw aninvalid-state
if the socket is not bound (according to the WIT file), but the test is not asserting for that. Did I understand this correctly? I would like to have more details about this specific case.@pchickey @badeend