Closed pavelsavara closed 3 weeks ago
cc: @badeend, @dicej
INVALID_STATE
is already mapped:
case NETWORK_ERROR_CODE_INVALID_STATE:
case NETWORK_ERROR_CODE_NOT_IN_PROGRESS:
abort(); // If our internal state checks are working right, these errors should never show up.
break;
Given that wasi-libc correctly follows the state diagram this behavior is the correct thing to do, IMO.
It's wasmtime that's at fault here. It (and every other engine) should either:
connect
ing from a bound state (the preferred option of course), or:error-code::not-supported
if it doesn't support connect
ing from a bound state.
__wasi_sockets_utils__map_error
is missing conversion forNETWORK_ERROR_CODE_INVALID_STATE
forconnect
inwasi:socket
Test case
TcpClientSocket_WhenBoundToWildcardAddress_LocalEPChangeToSpecificOnConnect
https://github.com/dotnet/runtime/blob/89f245e722eda87869dbb04690cb91361af8174c/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs#L82-L103Place to fix https://github.com/WebAssembly/wasi-libc/blob/7d4d3b83fc66c79b3faa5989e67ed2d1042dacaf/libc-bottom-half/sources/sockets_utils.c#L20-L22
Log