question

SatvaSolutions-1281 avatar image
0 Votes"
SatvaSolutions-1281 asked ·

For .Net core webapi and angular, Signalr response not getting client side from server side when SignalR client has connected to server



I have created one web application using .Net core web api as backend side and angular8 as front-side.

Now we implemented signalr feature.

sometimes signalR not working, when SignalR client has connected to the server but gets no message from the server.

I added my signalR backend code as backend side as follows.

 await hubContext.Clients.Client(userSignalrCnnectionID).SendAsync("updatescards", cardupdates)

I already checked some property after send signalr for both cases(when signalr working or when signalR not working) like Status(its value "RanToCompletion"), IsCompleted(its value true), IsCompletedSuccessfully(its value true), IsFaulted(its value false), IsCancelled(its value false).

Please let me know why sometimes not getting response message from front-side(i checked not getting any exception from backend code)

dotnet-aspnetcore-webapidotnet-aspnetcore-realtime
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

miwan2-msft avatar image
0 Votes"
miwan2-msft answered ·

Hi, @SatvaSolutions-1281
It's hard to provide userful information for your case. I suggest you could gather more diagnostics from your application to help troubleshoot issues. The details you could check this article Logging and diagnostics in ASP.NET Core SignalR.

In the default configuration, SignalR logs very little information, but this can configured. See the documentation on ASP.NET Core logging for details on configuring ASP.NET Core logging.



If the answer doesn’t solve your issue, please provide more details of error that will help us track down what’s happening.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Best Regards,
Michael Wang


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello Michael,

Thanks for your wonderful answer.

I added trace/debug logs in from side(angular side) as per your suggestion.
78353-tracelog.jpg

I noticed every time getting a response from backend API but sometimes message response not getting that time I got 11 lengths. if data is coming then the length is more than 100. Please check my below screenshots.
78279-getting-data.png78371-not-getting-data.png

0 Votes 0 ·
getting-data.png (18.6 KiB)
tracelog.jpg (20.1 KiB)