Uchiha-Peng opened issue #4004.
peterhuene edited issue #4004:
<img width="650" alt="image" src="https://user-images.githubusercontent.com/20633089/162136463-f08aea81-06fd-4de6-9f0d-1c6e5d24d437.png">
When I use the
wasmtime xxx.wasm
command to run the .NET web application and specify the program listening port through--tcplisten localhost:8000
, the console always prints :info: Microsoft.Hosting.Lifetime Now listening on: http://localhost:5000
But the real port of the web application is not 5000
The command I use is as follows:
wasmtime webapp.wasm --tcplisten localhost:8000 info: Microsoft.Hosting.Lifetime Now listening on: http://localhost:5000
bjorn3 commented on issue #4004:
I suspect dotnet simply reports localhost:8000 as default for the lack of a wasi api to retrieve the actual address and port it listens on.
--tcplisten
gives the wasi program a socket on which it can call sock_accept. Nothing more, nothing less AFAIK.
Uchiha-Peng commented on issue #4004:
@peterhuene Thanks for your patient reply.
haraldh commented on issue #4004:
The wasm application cannot get any socket stats for pre-opened sockets, as
sockaddr
is not defined in WASI, so it always reports0.0.0.0
port0
. The string you are seeing must be some fallback.
Last updated: Dec 23 2024 at 13:07 UTC