Signalr: Not reciving messages with Microsoft.AspNet.SignalR.Client in client .Net Core 2.0

Created on 30 Apr 2018  ·  9Comments  ·  Source: SignalR/SignalR

Hi,

I have a SingalR server with .Net Framework 4.5.2, and a SignalR Client ( Console Application) with .Net Framework 4.5.2 using:

Server:
image

Client:
image

All of them are working fine since months ago.

But currently I have another SignalR client in a .Net Core 2.0 Console Application using the same version of Microsoft.AspNet.SignalR.Client. It is connecting fine, but is not reciving messages from the hub connection. Is there any issue with this nuget in .Net Core?

This is the code:

        var hubProxy = hubConnection.CreateHubProxy("MyHub");

        hubProxy.On("created", data =>
        {
            Console.WriteLine("Incoming Created  data: {0}", data);
        });

        hubProxy.On("deleted", data =>
        {
            Console.WriteLine("Incoming Deleted data: {0}", data);
        });

        hubConnection.Start().ContinueWith(x =>
        {
            hubProxy.Invoke("subscribe", "firstFeature", "secontFeature");
        }).Wait();

        Console.WriteLine("Connected to {0}", hubConnection.Url.ToString());

Thanks!

more-info-needed

Most helpful comment

Hi!

I already did it: https://github.com/aspnet/SignalR/issues/2156 and they redirected me here...

All 9 comments

Hello @georginacm

Try to do the question here https://github.com/aspnet/SignalR this repository is the one related to signalR net core.

Regards.

Hi!

I already did it: https://github.com/aspnet/SignalR/issues/2156 and they redirected me here...

You are in the correct repo. So to clarify, since you brought up .NET Core, does this only fail when the SignalR client is used from a .NET Core application? I.e. does the same code work in .NET Framework?

Can you post an example that reproduces the issue?

Closing this as we haven't heard from you. Please feel free to comment if you're able to get the information we're looking for and we can reopen the issue if we're able to identify the problem.

I would like to re-open this issue, as I nearly the exact scenario and "probably" the same failure.

net461 server running Microsoft.AspNet.SignalR" Version="2.2.3"
net461 client running Microsoft.AspNet.SignalR.Client" Version="2.2.3"

all is wonderful, connected with websockets, does a invoke (call it subscribe or join group), gets data.

but if I change the client project from
<TargetFramework>net461</TargetFramework>
to
<TargetFramework>netcoreapp2.0</TargetFramework>

I can get connected, but only with SSE, and I mostly get InvalidOperation exceptions when invoke is called. Occasionally the invoke succeeded, but its unclear the scenario for success.

Can you enable the client-side logging described in our documentation and attach the logs here? (Please do not just copy-paste them in, please drag and drop the file on to the comment to attach it as a separate file, the logs are large and putting them in the comment body makes it very difficult to review).

Also, if you can post a sample application that reproduces the issue that would help.

looks like I had a load balancer issue. The connection was being made to one server, but invoke was going to a different server. LB in question was an F5 big-ip, it needed default persistence setup.

The connection was being made to one server, but invoke was going to a different server

This should be fine in ASP.NET SignalR as long as you have a backplane registered. See the scale-out documentation here: https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr

I dont have a backplane, and dont want one. Each Server was supplied with a eventsource of equal data. the group membership was the key fault that was corrected by getting the client to the right server.

I am pretty sure I can leave this closed. the dotnet core client using the framework signalr.client is working properly for me with 3 servers after the load balancer persistence change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vaccano picture Vaccano  ·  5Comments

markrendle picture markrendle  ·  4Comments

cceraja picture cceraja  ·  6Comments

jakeb16 picture jakeb16  ·  8Comments

Chrillemeter picture Chrillemeter  ·  7Comments