signalr-2

how to create a signalR hub proxy in javascript, having hubs in class library?

回眸只為那壹抹淺笑 提交于 2020-01-05 04:13:13
问题 currently, am working on chat application using signalR and agsxmpp library, I have seen many examples how to create a proxy of hub in javascript. however, my architecture is differ from these examples. I have class library and a web project(web forms) Hubs are written in class library, and java script exists in web project, I want to create proxy of hub(written in class library) in java script I have tried a lot. but couldn't find a solution. I have read owin(startup.cs) but still not a

SignalR- Jquery : $.connection.chathub returns undefined

此生再无相见时 提交于 2019-12-25 08:48:21
问题 I'm creating a chat application using Asp.net MVC, AngularJs, SignalR and Jquery. In the Chat View when I'm trying set the value for chat object it passes null value the code reference is inside the brackets ( var chat=$.connection.chathub;). No other function works because of this. I'm using "Microsoft.AspNet.SignalR.2.2.2" in this project. And jquery and signalr related scripts such as 'jquery.signalR-2.2.2.js ,jquery-ui-1.12.1.js' and few other jquery libraries as well. Can anyone help me

SignalR combined with load balancer missing messages

柔情痞子 提交于 2019-12-24 07:58:47
问题 I have 2 web servers (IIS 8.5) behind a hardware firewall and our application uses SignalR for some real-time updates. We are using SQL Server as the backplane to help us work in this load balanced environment. Additionally we are using sticky sessions on the load balancer to help us keep the users on the same web server during their session. When we are running in this hardware configuration we lose at least 1/3 of our messages. Sometimes we get all the expected messages but more often than

Azure SignalR Service Connection is not active

天大地大妈咪最大 提交于 2019-12-23 13:01:09
问题 I updated our signalr packages from 2.4.0 and added RunAzureSignalR instead of RunSignalR . Added this code in de Startup.cs app.Map("/signalr", map => { var hubConfiguration = new HubConfiguration { EnableDetailedErrors = true }; map.RunAzureSignalR(typeof(Startup).FullName, hubConfiguration, options => { options.ConnectionString = AppApiSettings.SignalRServiceConnectionString; }); }); But when I try to send a message to the hub I get an exception The connection is not active, data cannot be

Group Chat Signal R with Web API

杀马特。学长 韩版系。学妹 提交于 2019-12-18 09:39:11
问题 Below i have three table which is used for GroupChat,Firstly I am creating the group its all data wil be inserted into GroupTable,then on success of groupCreation i am calling insertConnectionId function which will call the MapGroupConnectionId on backend which generate the SignalR connection ID and insert into GroupTable using groupId and groupCreaterId, its working fine and i have Group Friends Table which consist of Friends ID,Now when any friend sent message to particular Group, i need to

Signalr example app from official documentation does not work on IIS

痞子三分冷 提交于 2019-12-12 03:47:03
问题 I've spent too much time trying to figure this out, and I'm starting to exhaust the threads here on SO that are dealing with this very issue. Feel free to link to other threads about this issue, but I've probably already consulted those with no success. I'm following Microsoft's Signalr example app from this url: https://docs.microsoft.com/en-us/aspnet/signalr/overview/getting-started/tutorial-getting-started-with-signalr I'm running IIS 8.5 on Windows Server 2012 R2, SignalR 2.2.1, and .Net

SignalR2 OnConnected not working as per documentation

大憨熊 提交于 2019-12-11 04:30:10
问题 Below is the code I wrote for SignalR implementation based on ASP.Net documentation and I use manual proxy creation method. I Could see only negotiate happening and received a Connection id. I can't see OnConnected method in my hub gets executed when I start connection. According to the note section in the document I have attached event handler before I call start method SignalR Hub public class MyTestHub: Hub { private static Dictionary<int, List<string>> userConnections = new Dictionary<int

SignalR Websocket Exception when closing client

跟風遠走 提交于 2019-12-09 15:37:44
问题 When starting and stopping a SignalR client that is connected to a basic self hosted server like this: async public void Start(string url) { _connection = new HubConnection(url); _proxy = _connection.CreateHubProxy("hubname"); await _connection.Start().ContinueWith((task) => IsRunning = true); } public void Stop() { _connection.Stop(); } I get the following exception when calling the "Stop" method (including trace messages): SignalR.Transports.TransportHeartBeat Verbose: 0 : KeepAlive

How to securely send a message to a specific user

主宰稳场 提交于 2019-12-07 00:28:35
问题 I am using ASP.NET MVC 5 and SignalR. I want to send a message to a specific user. I have followed the method which is explained in this tutorial (also suggested by this answer). I have overridden IUserIdProvider , to use UserId as connectionId . public class SignalRUserIdProvider : IUserIdProvider { public string GetUserId(IRequest request) { // use: UserId as connectionId return Convert.ToString(request.User.Identity.GetUserId<int>()); } } And I have made the change to my app Startup to use

How to securely send a message to a specific user

匆匆过客 提交于 2019-12-05 05:33:06
I am using ASP.NET MVC 5 and SignalR. I want to send a message to a specific user. I have followed the method which is explained in this tutorial (also suggested by this answer ). I have overridden IUserIdProvider , to use UserId as connectionId . public class SignalRUserIdProvider : IUserIdProvider { public string GetUserId(IRequest request) { // use: UserId as connectionId return Convert.ToString(request.User.Identity.GetUserId<int>()); } } And I have made the change to my app Startup to use the above custom provider: public partial class Startup { public void Configuration(IAppBuilder app)