MQTTnet icon indicating copy to clipboard operation
MQTTnet copied to clipboard

'System.Net.Sockets is not supported on this platform.'

Open 15703849331 opened this issue 3 years ago • 4 comments

I encountered this error when I was using Blazor to host the project. I can't solve it. Please help me.

Maybe I forgot something, but I also made this mistake when I was using your case, I don't understand where I made the mistake, I was doing the same exercise as your project, I even changed all the variable names, but this mistake still happened. Please help me, thank you.

15703849331 avatar Jul 26 '22 09:07 15703849331

@15703849331 please provider more details (use case, stack trace)... Do you want to host a broker in a Blazor application? Do you want to connect to a broker from a Blazor application?

MD-V avatar Jul 26 '22 12:07 MD-V

You are probably trying to run the Broker in the browser (so Blazor on WASM). This will not work (at least not by default) as you have no direct access to the network when running in the browser. You might try Blazor on Server.

Jeanot-Zubler avatar Jul 26 '22 13:07 Jeanot-Zubler

@15703849331 请提供更多详细信息(用例、堆栈跟踪)...是否要在 Blazor 应用程序中托管代理?是否要从 Blazor 应用程序连接到代理? 谢谢您的回复,先为我们之间的时差感到抱歉。 因为一些原因我只能先将其搁置一下,在做后续的处理,我也将删除这个问题。 谢谢你们的回答

15703849331 avatar Jul 27 '22 01:07 15703849331

您可能正在尝试在浏览器中运行代理(因此在WASM上为Blazor)。这将不起作用(至少默认情况下不起作用),因为在浏览器中运行时,您无法直接访问网络。您可以在服务器上试用 Blazor。

谢谢您的回复,先为我们之间的时差感到抱歉。 因为一些原因我只能先将其搁置一下,在做后续的处理,我也将删除这个问题。 谢谢你们的回答

15703849331 avatar Jul 27 '22 01:07 15703849331

Closing this due to inactivity.

chkr1011 avatar Sep 13 '22 06:09 chkr1011