You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason a normal System.Net.Sockets.Socket isn't supported in WASM (I thought it was but it turns out the browser doesn't support sockets), is there any chance you can support using System.Net.WebSockets on the ConnectionFactory so that this can properly be used in WASM Blazor applications?
You should be able to run this app and see normal behaviour, however if you uncomment the code in Client\Program.cs, when you run, the app will throw an exception in the browser:
System.AggregateException: One or more errors occurred. (System.Net.Sockets is not supported on this platform.)
---> System.PlatformNotSupportedException: System.Net.Sockets is not supported on this platform.
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at ProtoBuf.Grpc.Lite.ConnectionFactory.<>c__DisplayClass2_0.<<ConnectSocket>b__0>d.MoveNext() in /_/src/protobuf-net.GrpcLite/ConnectionFactory.cs:line 75
--- End of stack trace from previous location ---
at ProtoBuf.Grpc.Lite.ConnectionFactory.<>c__DisplayClass13_0.<<AsStream>b__0>d.MoveNext() in /_/src/protobuf-net.GrpcLite/ConnectionFactory.cs:line 346
--- End of stack trace from previous location ---
at ProtoBuf.Grpc.Lite.ConnectionFactory.<>c__DisplayClass12_0`1.<<AsFrames>b__0>d[[System.Net.Sockets.NetworkStream, System.Net.Sockets, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/protobuf-net.GrpcLite/ConnectionFactory.cs:line 327
--- End of stack trace from previous location ---
at ProtoBuf.Grpc.Lite.ConnectionFactory.CreateChannelAsync(Func`2 factory, CancellationToken cancellationToken) in /_/src/protobuf-net.GrpcLite/ConnectionFactory.cs:line 427
at Program.<Main>$(String[] args) in D:\Repos\GrpcLiteWasm\Client\Program.cs:line 18
--- End of inner exception stack trace ---
The text was updated successfully, but these errors were encountered:
ScottKane
changed the title
Allow a ClientWebSocket version in the ConnectionFactory
Support WebSockets version in ConnectionFactory
Jun 2, 2022
For some reason a normal
System.Net.Sockets.Socket
isn't supported in WASM (I thought it was but it turns out the browser doesn't support sockets), is there any chance you can support usingSystem.Net.WebSockets
on theConnectionFactory
so that this can properly be used in WASM Blazor applications?Here is an example of the issue (this app is using preview versions of GrpcLite from your myget feed): https://github.com/ScottKane/GrpcLiteWasm
You should be able to run this app and see normal behaviour, however if you uncomment the code in
Client\Program.cs
, when you run, the app will throw an exception in the browser:The text was updated successfully, but these errors were encountered: