Closed viniwrubleski closed 3 years ago
Wow this is very cool! Maybe you can set up a GitHub repository with your code so I don't need to set it up myself and then I can try troubleshooting this?
Elad
Sure, I put the code here: https://github.com/viniwrubleski/WampBlazor
Try 21.0.0-blazor-23 from the GitHub packages. I'll keep updating this branch with adjustments for running WampSharp on Blazor.
Nice, it seems to be working now. The reconnector is working too.
protected override async Task OnInitializedAsync()
{
var serverAddress = "ws://127.0.0.1:5000/ws";
var factory = new DefaultWampChannelFactory();
var channel = factory.CreateJsonChannel(serverAddress, "realm1");
Func<Task> connect = async () =>
{
await channel.Open().ConfigureAwait(false);
var proxy = channel.RealmProxy.Services.GetCalleeProxy<IWeatherForecastService>();
forecasts = await proxy.Get();
StateHasChanged();
};
var reconnector = new WampChannelReconnector(channel, connect);
reconnector.Start();
await Task.Yield();
}
Cool! Let's close this for now and please open issues about things that don't work properly on Blazor. I expect there will be some.
Elad
Hi there! I wasn't able to find the mentioned package in the GitHub packages list. I got the exact same issues with version 20.1.1 from nuget, so I guess the changes aren't integrated in the release? Would be amazing if you could make blazor work right from nuget :)
Cheers, Lukas
Update: I was able to narrow my issue down a bit, so maybe it's a bit different than viniwrubleski's case. Looks like awaiting a channel.Close causes it in my case
await _channel.Close("Auth Reconnect", new GoodbyeDetails {Message = "Auth Reconnect"});
Hi, I am trying to use the library with in a project in Blazor WebAssembly with a ASP.NET Core API. I modified the Weather Forecast example in the blazor demo, and it is working:
But, if the server goes down the whole APP stops working because of this exception: