signalr

Signalr deserializes my objects incorrectly in IIS 7.5 and Edge/IE, foreverFrame broken?

大兔子大兔子 提交于 2019-12-07 03:02:29
问题 So I have a simple Signalr/Knockout project that uses the mapping plugin to bind a simple object (item with an array of more items) to viewModels I defined in JS: var someObjectMapping = { 'MyItemArray': { create: function (options) { return new MyItemViewModel(options.data); } } } var myItemMapping = { 'ItemChildren': { create: function (options) { return new ItemChildViewModel(options.data); } } } var SomeObjectViewModel = function (data) { ko.mapping.fromJS(data, someObjectMapping, this);

Using SignalR as service layer for WebRTC

爱⌒轻易说出口 提交于 2019-12-07 02:56:54
问题 This is a follow-up to another question I asked, but with more precise information. I have two fundamentally identical web pages that demo WebRTC, one using XSockets as the backend signaling layer, and one using SignalR as the backend signaling layer. The two backends are fundamentally identical, differing only at the points where they (obviously) have different ways of sending data down to the client. Similarly, the TypeScript/JavaScript WebRTC code on the two clients is completely identical

How does Signal-R fit in the IIS activation model?

别说谁变了你拦得住时间么 提交于 2019-12-07 01:40:27
问题 I am learning Signal-R, and this is something that has been in my head during all time. How does Signal-R fits in the IIS/ASP.NET life cycle? How long does the Hubs live (I see they have re-connection semantics)? Does IIS does prevent the shutdown of an AppDomain that has a persistent connection? It is my understanding that IIS is designed to handle request-response scenarios. A request hits IIS, this finds the AppDomain, activate it, and then pass the request to it. And after an idle time,

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 broadcast events from Web Api project to MVC app on a different App Pool using SignalR

僤鯓⒐⒋嵵緔 提交于 2019-12-06 17:24:59
My windows server running IIS has an MVC application in one app pool and a Web Api project in another. These projects were developed in different solutions. The web app currently communicates with the Web Api to use as a rest service. I need to add a SignalR hub to the Web Api project so that it can broadcast some data to the web app in certain situations. How can I go about doing this? I have read in other posts that you need to use Sql server as a backplane but I'm not sure that is necessary since the two apps are on the same server. If this is the case though, how does the Web app pick up

SignalR 2.0 in VS2012 registration and Dependency Injection

北慕城南 提交于 2019-12-06 15:59:11
I was able to work with SignalR 1.13 with my own DI like this: //Funq container GlobalHost.DependencyResolver = new FunqDependencyResolver(container); RouteTable.Routes.MapHubs(); Now with the new version 2.0 I am stuck. using Microsoft.Owin; using Owin; //SignalR 2.0 no longer uses RouteTable.Routes.MapHubs(); [assembly: OwinStartup(typeof(SignalRChat.Startup))] namespace SignalRChat { public class Startup { public void Configuration(IAppBuilder app) { app.MapSignalR(); } } } (New SignalR 2.0 setup in VS2013 screenshot) Firstly, it's a screen from VS2013 from here . my VS2012 Pro doesn't have

How to buffer messages on signal hub and send them when the right client appears?

随声附和 提交于 2019-12-06 15:56:34
I hawe two type of clients connecting my signalR server (ASP.NET Core). Some of them are senders, and some of them are receivers. I need to route messages from senders to the receivers, which is not a problem, but when there is no receivers, I need to somehow buffer messages and not lose them (probably the best is ConcurrentQueue in some kind of a singleton class) but when the first receiver connect, the message buffer needs to start dequeue. Which is the best approach for this? I created singleton class that wraps arround ConcurrentQueue collection and I enqueue and dequeue messages there.

Calling SignalR service from a BackgroundWorker in ABP

风格不统一 提交于 2019-12-06 15:35:47
I have a BackgroundWorker which is supposed to broadcast something to all online clients in 5 seconds interval: DeactivationBackgroundWorker: public class DeactivationBackgroundWorker : PeriodicBackgroundWorkerBase, ISingletonDependency { private readonly IRepository<HitchRequest, long> _hitchRequestRepository; private readonly IHitchHub _hitchHub; public DeactivationBackgroundWorker(AbpTimer timer, IRepository<HitchRequest, long> hitchRequestRepository, IHitchHub hitchHub) : base(timer) { _hitchRequestRepository = hitchRequestRepository; Timer.Period = 5000; _hitchHub = hitchHub; } protected

How to publish messages using the SignalR SqlMessageBus

坚强是说给别人听的谎言 提交于 2019-12-06 15:34:01
问题 I have a Windows Service that I'd like to periodically publish some data. I know I can use the .NET HubConnection object to create a proxy to a SignalR hub and send a message through it but since the web app is hosted on an IIS web farm that can get a bit hacky. The web farm hubs are connected using the SQL Server-based SqlScaleoutConfiguration backplane. What I'd really like to do some thing like this: var config = new SqlScaleoutConfiguration(sqlConnString); GlobalHost.DependencyResolver

SignalR Working on One Computer But Not Others

若如初见. 提交于 2019-12-06 15:05:43
We have a Windows service hosting SignalR. The same code is running on different machines, with different results. If I go to this link on my laptop, it works: https://localhost/signalr/negotiate Response: { "Url":"/signalr", "ConnectionToken":"AQAAANCMnd8BFdERjHoAwE/...==", "ConnectionId":"0a09e290-c8af-48d6-b791-f05e3b8930b0", "KeepAliveTimeout":20.0, "DisconnectTimeout":30.0, "ConnectionTimeout":110.0, "TryWebSockets":false, "ProtocolVersion":"1.2", "TransportConnectTimeout":5.0, "LongPollDelay":0.0 } If I go to that same link on my desktop, I get this: I checked the IE settings and the TLS