Stream: wasmtime

Topic: .Net Socket Error


view this post on Zulip Email Gateway (Sep 16 2024 at 07:30):

From: Henry Rydzkowski <hrydz13@gmail.com>
Hi

My .Net 8 console application creates a socket using the System.Net.Sockets
namespace. It is compiled to wasm and run with wasmtime but I get the error
'System.PlatformNotSupportedException: System.Net.Sockets is not supported
on this platform.'. What should I do to solve this problem?

Thanks
Henry

view this post on Zulip Joel Dice (Sep 16 2024 at 12:39):

.NET does not yet support WASI sockets -- not even experimentally. @Pavel Šavara is currently working on it. Experimental support might be available as part of .NET 10, but not in earlier releases.

view this post on Zulip Joel Dice (Sep 16 2024 at 12:59):

However, you can use wasi-sockets in .NET by using wit-bindgen to generate C# bindings from the wasi-sockets WIT files and using those bindings directly. componentize-dotnet is probably the easiest way to do that. Using the bindings directly isn't idiomatic, and it isn't compatible with anything that expects System.Net.Sockets, but it does work.

view this post on Zulip HenryR13 (Sep 16 2024 at 13:49):

Thank you Joel for your reply.


Last updated: Oct 23 2024 at 20:03 UTC