signalr

SignalR cannot be used with .Net Core

大憨熊 提交于 2019-12-09 09:37:55
问题 I am trying to install SignalR using NuGet package manager in my C# Asp.Net core project, but I get this error that SignalR is not compatible with .net core, is it really not supporter yet? or can I do something to get it work? (I am using VS2017 if it was important to mention that). The error: Restoring packages for D:\Test\Test.WebAPI\Test.WebAPI.csproj... Package Microsoft.AspNet.SignalR.Core 2.2.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.AspNet

Passing strongly typed Hubs in SignalR

99封情书 提交于 2019-12-09 08:40:44
问题 I've just updated some SignalR references and things have changed somewhat in order to allow for generically typed Hubs Hub<T> . In the existing examples and documentation such as at: Server-Broadcast-with-Signalr we have a static class holding references to clients via the following mechanisms: public class StockTicker() { private readonly static Lazy<StockTicker> _instance = new Lazy<StockTicker>( () => new StockTicker(GlobalHost.ConnectionManager.GetHubContext<StockTickerHub>().Clients));

Is SignalR a suitable substitute for jQuery Ajax (or similar)

谁说我不能喝 提交于 2019-12-09 08:23:31
问题 As per title, would SignalR be a suitable substitute for general Ajax (e.g. jQuery Ajax) updates used in web pages. Thanks 回答1: If all you need to do is browser-initiated calls to the server triggered by user actions then you should just use jQuery Ajax. Only use SignalR where the server needs to update the client asynchronously to any user action. Use it in situations where you would traditionally have used a timer and an Ajax call to poll the server repeatedly to see if anything has changed

SignalR and HttpContext/Session

只谈情不闲聊 提交于 2019-12-09 08:20:40
问题 I understand why SignalR doesn't give you access to the HttpContext. However, this is quite problematic for us. Let me explain: Our application is a Multi-Tenant application where the user chooses the environment while logging in. This basically registers the ConnectionStringName in the HttpSession. In our SignalR Hub, we need to access the database on Disconnect . But this is not possible because we have no HttpContext at this point and cannot determine the environment to write to. Can

SignalR Connection Blocked Until page images load

三世轮回 提交于 2019-12-09 06:11:26
this is my signalr hub connection : chat = $.connection.chat; $.connection.hub.start().done(function () { // problem is here // this part is waiting for full page load.! }); why signalr connection waits for my page contents to load complete? i have a <img src='BAD SERVER'/> sometimes take 2 minutes to load successfully. and the connection is waiting for images loaded.! how can i fix this problem ? Try this: chat = $.connection.chat; $.connection.hub.start({ waitForPageLoad: false }).done(function () { // problem is here // this part is waiting for full page load.! }); 来源: https://stackoverflow

SignalR connect/disconnect hub blows up

倾然丶 夕夏残阳落幕 提交于 2019-12-09 04:57:29
问题 Also opened this as an issue here but hoping someone has seen this.. I've got a very simple hub that implements IConnected/IDisconnect. In a standalone project, this hub tested out great. When I dropped it into my real project, where I already have some other hubs, adding it resulted in no hubs being available (confirmed that none show up in /signalr/hubs). I then commented out IConnected/IDisconnect in this hub and re-compiled, and it showed up along with the rest. Adding the interfaces back

SignalR Chat App in WinForm With Remote Clients

早过忘川 提交于 2019-12-09 03:21:38
问题 i am new in signalR , i have tried and learn from different web sites like github and etc etc But i couldn't find the solution for my problem.... and now i am getting confused... My problem is: I have developed a Chat app in Winform with Web Services and Centralized Database and it is working fine in different countries as in different branches of one organization. But i want to convert that Chat App into SignalR to achieve more efficiency but i couldn't understand , how to do it in SignalR.

Angular 2 + SignalR - Accessing Angular internals from external script

喜欢而已 提交于 2019-12-09 03:16:28
I'm using SignalR with an Angular2 app, where we want the SignalR client methods to call into the Angular app with data received from the server, and then have Angular redo the data-bindings. For example, within the Angular app I expose a global variable for our store, which has a collection on it. E.g. (TypeScript) .... export class Store{ Customers : Customer[]; constructor(){ window["GlobalStore"] = this; } setCustomers (customers : Customer[]){ this.Customers = customers; } } .... and in my client SignalR javascript I have a function: $.connection.MyHub.client.receive = function(data){ /

SignalR: How to add client call after the hub is started?

谁都会走 提交于 2019-12-08 19:44:14
问题 First off, I just started trying to add SignalR 2 to my existing Angular SPA project. I have a main controller which starts the hub right away that is feeding some messages to the client. Inside, I have several sub pages and each could subscribe to a different hub for services. The problems is that the client doesn't receive message because it is hooked up after the hub is already started in the main controller. As a test, if I comment out the hub start in the main controller, the one in the

“Value cannot be null” when passing null arguments to SignalR client-side proxy

天涯浪子 提交于 2019-12-08 17:05:48
问题 Using SignalR (v2.0.2) I'm getting this exception: Value cannot be null. Parameter name: o at Newtonsoft.Json.Utilities.ValidationUtils.ArgumentNotNull(Object value, String parameterName) at Newtonsoft.Json.Linq.JToken.FromObjectInternal(Object o, JsonSerializer jsonSerializer) at Newtonsoft.Json.Linq.JToken.FromObject(Object o, JsonSerializer jsonSerializer) at Microsoft.AspNet.SignalR.Client.Hubs.HubProxy.Invoke[T](String method, Object[] args) I'm calling the HubProxy with reflection, and