signalr

When SignalR made 8-10 connections at a time live chat doesn't work

社会主义新天地 提交于 2020-01-11 03:57:12
问题 I am developing live chat using SignalR. It is great library. But i coped with one problem that I cant resolve for some time. So problem in when signalR made 8-10 connections at a time live chat doesn't work any more. Maybe it is b/c i run everything on local machine? I thought maybe I made mistake somewhere. So I found simplest chat. You can download it here. I opened it in 10 windows and it dont work anymore. Is that performance issue of signalR or programmers mistake? How can i make it

Calling SignalR hub clients from elsewhere in system

前提是你 提交于 2020-01-09 08:27:47
问题 I've set up a SignalR hub to communicate between the server and client. The hub server side code is stored in a class called Hooking.cs. What I want is to be able to call a method defined in Hooking.cs to allow me to broadcast messages to any connected clients from anywhere in my application. It seems that a new instance of Hooking.cs is created for every client/server call, so I had hoped that I would be able to use something like var hooking = new Hooking(); hooking.Test(); with the method

Nested object values does not follow in parameter from ajax call to actionmethod

狂风中的少年 提交于 2020-01-07 08:23:15
问题 The nested object values in the parameter does not follow. How can i get the full object including the nested values to follow in the actionmethod in the controller? There is values in the object inside the red ring on the pictures when i call the ajac method. But does not follow in the controller mapHub.client.requestForHelpInClient = function (requestDetails) { debugger; $.ajax({ type: "GET", url: '@Url.Action("RequestPartialView", "Supplier")', data: requestDetails, success: function

C# Windows Service Events

北慕城南 提交于 2020-01-07 06:36:05
问题 So I am just messing around here nothing production just proof of concept with my first ever Windows Service. I am trying to essentially create a windows service that sits as the listener for a signalr connection. In essence, I will have a windows application and a windows service. The win service will handle connecting to the signalr hub and on signalr calls fire an event. The windows application will listen for these events and perform actions based on them. Currently I cannot get this to

Create hub instance SignalR 3

自作多情 提交于 2020-01-07 05:27:12
问题 I am tring to create an instance of a Hub so that a can call a method on all of the clients. In Signalr 2 I would have used. GlobalHost.ConnectionManager.GetHubContext<Hub>(); But this seems to be missing in Signalr 3 I tried the following but I get an error. IHubActivator.Create Using a Hub instance not created by the HubPipeline is unsupported. Does anybody know how this can be accomplished in SignalR 3? I am using signalr3 rc1 回答1: You can resolve the instance using dependency injection;

mvc 下的 signalR使用小结

不问归期 提交于 2020-01-07 05:00:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> sirnal下有两种使用。 一种是 Persistent Connection ,另外一种是 Hubs 。详细请看 https://github.com/SignalR/SignalR/wiki ; hubs支持浏览器与客户端互相调用方法。所以应用更广泛。 在前台页面上写上如下脚本: //初始化signalr function initSignalr(parameters) { var chat = $.connection.chat;//这里的chat为服务器上的继承了HUB的类的HubName。 chat.client.addMessage = function(msg) { $('#submit').trigger('click'); $('#submit2').trigger('click'); }; $.connection.hub.start().done(function() { }); } 上面给client写了一个addmessage方法。之后,服务器将调用它 。 下面这条语句执行的方法是空的, 但是必须要有 : $.connection.hub.start().done(function() { }); 在页面加载完毕后会通过此方法向浏览器发送请求。function里可以写一些绑定事件,如

Signal r notification

我只是一个虾纸丫 提交于 2020-01-07 03:09:05
问题 I am creating an application using signal r to send notification. I am using VS 2012. In my Notification view I have added the code below in @model App.Models.Notification . @{ ViewBag.Title = "Index"; } @section Scripts { <script src="/Scripts/jquery-1.8.20.min.js"></script> <script src="~/Scripts/jquery.signalR-2.2.0.js"></script> <script src="/signalr/hubs"></script> <script type="text/javascript"> $(function () { var proxy = $.connection.notificationHub; alert(proxy); $("#button1").click

ASP.NET / C#: Run command at specific interval

喜你入骨 提交于 2020-01-06 19:05:29
问题 I have an auction site coded using SinglarR, and MVC5.I have a credit card token stored in my database for every single bidder. At the end of the auction, the winning bidder's credit card needs to be charged. What would be the most efficient way to accomplish this? I thought about using a filter, however, the code would only be ran the next time a visitor arrives, which might be a long period of time on some days 回答1: Sounds like you need a scheduled task. It can be done with HttpModule.

ASP.NET Core SignalR系列之Hub教程

醉酒当歌 提交于 2020-01-06 16:07:54
本文内容 什么是 SignalR 中心 配置 SignalR 创建和使用SignalR 向客户端发送消息 强类型中心 1 . SignalR 中心 利用SignalR, 你可以从服务端对链接的客户端调用方法。在服务端定义客户端调用的方法; 在客户端定义服务的需要调用的方法。SignalR 负责使实时的客户端到服务端和服务端到客户端的通信成为可能。 2. 配置 SignalR SignalR 中间件需要一些服务,这些服务通过调用services.AddSignalR 进行在 Startup 的 ConfigureServices 进行注册配置 public void ConfigureServices(IServiceCollection services) { services.Configure<CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; });

C# MVC - Send message with SignalR from server to Caller

大城市里の小女人 提交于 2020-01-06 15:52:13
问题 I have a request from client to Server using SignalR-2.2.1 . After that request, Server will send the results back to the caller. Here is my JavaScript code : $(document).ready(function () { var myHub = $.connection.signalHub; myHub.client.receive = function (tmp) { var obj = $.parseJSON(tmp); //do something }; $.connection.hub.start().done(function () { $('#xxxxx').click(function () { var form = $("form"); form.submit(); myHub.server.sendSomething(); }); }).fail(function (reason) { //do