asp.net-core-signalr

How do i map user connection and user id in signalr so that i can send a message to a specific user

喜欢而已 提交于 2021-01-29 02:20:45
问题 I want to send a private message to a user, i have created a hub but unfortunately i have no idea how to do it in signalr core, the documentation also doesn't have any article in it. 回答1: How do i map user connection and user id in signalr so that i can send a message to a specific user To achieve above requirement, please refer to the following example. ChatHub class: public class ChatHub : Hub { public static List<KeyValuePair<string, string>> ConnectedIds = new List<KeyValuePair<string,

Communicate web app and api project using SignalR & StackExchangeRedis

时光怂恿深爱的人放手 提交于 2021-01-27 21:23:51
问题 I'm working with a project built with ASP.NET Core 2.2. The main solution contains multiple projects, which includes API, web and other class libraries. We've used SignalR to displaying shared messages/notifications between the API project and the web project. For example, adding a new employee record from an API should call SignalR Hub and all the web client should received the notification. To make it communicate, we have used Radis with SignalR // SignalR Configuration services.AddSignalR

Add headers to @aspnet/signalr Javascript client

天大地大妈咪最大 提交于 2021-01-27 21:02:46
问题 I'm using @aspnet/signalr Official Javascript client from This npm package I wondering if there is the way to add Header configuration to the client connection header How I build the connection let connection = new signalR.HubConnectionBuilder() .withUrl( "https://some.signalr-host.com" ) .build(); 回答1: Update after doing some research Seems like signalR js/ts client library doesn't support adding customize headers in anyways So, our solution is sending parameters through query string instead

ASP.NET Core SignalR websocket connection limit

*爱你&永不变心* 提交于 2021-01-27 13:52:44
问题 I produce load testing of SignalR (ASP.NET Core) application hosted at Windows Server 2016 standard using Microsoft.AspNetCore.SignalR.Client. Dotnet core hosting 2.1.1 installed And i can not create more than 3000 (2950-3050) connections. Already tried recomendations as described here: How to configure concurrency in .NET Core Web API? Limiting performance factors of WebSocket in ASP.NET 4.5? Set limit concurrent connections for websocket on iis 8 Added limits to UseKestrel (this seems to

Target specific user in group

爷,独闯天下 提交于 2021-01-07 06:31:52
问题 ASP.NET Core SignalR I know we can send messages to a group. I know we can send messages to a user. Is there a way to send messages to a user in a group, i.e. the intersection of the previous audiences. From what I understand: A group is a collection of connections with group name in metadata, and a user is a collection connections with user name in auth claims. A user in a group would be the collection of connections which belong to the specific user and are part of specific group. Afaik

User can not see reply message in chat app using signalr + angular

依然范特西╮ 提交于 2021-01-07 02:34:43
问题 I have chat application and in that backend is done by asp.net core and front end is in angular. Everything is working fine, just problem is as per below : Let's say User A send message to User B so User B see that message instantly. But when User B reply back to User A then User A can not see message instantly, But if User A refresh page OR click on any other username and click back on User B then he can see that reply message of User B. So any one can guide me what can be problem for this.