signalr

Scope error when using Autofac with SignalR

為{幸葍}努か 提交于 2019-12-04 06:31:36
I'm trying to inject an HttpContextBase in my SignalR hub: public class EventHub : Hub, IDisconnect { private readonly HttpContextBase _httpContextBase; public EventHub(HttpContextBase httpContextBase) { _httpContextBase = httpContextBase; } [...] } The registration code looks like this: private static void InitAutofac() { var builder = new ContainerBuilder(); var assembly = typeof (MvcApplication).Assembly; builder.RegisterControllers(assembly).PropertiesAutowired(); builder.RegisterModule(new AutofacWebTypesModule()); builder.RegisterFilterProvider(); builder.RegisterAssemblyTypes(assembly)

SignalR .NET Client doesn't support WebSockets on Windows 7

我怕爱的太早我们不能终老 提交于 2019-12-04 05:23:58
I've written a small echo-server (.net 4.5), console client (.net 4.5) and web client using SignalR and example presented here . Server is hosted in IIS8/Win8. Then I ran both clients on Win7. and I see that web client in Chrome uses webSockets, while console app client uses serverSentEvents. If I run console client on Win8, then webSockets transport is in use. Is it true that SignalR .NET client will use webSockets only on Win8 and higher? It's correct: .NET client uses WebSockets only on Win8 and higher. For a project I had to use real websocket connections in combination with SignalR. For

SignalR and Joining Groups

为君一笑 提交于 2019-12-04 05:14:11
I am looking at SignalR for a project I am working on, and it seems to be EXACTLY what I want. However one bit that I am still a bit baffled by is the groups and joining. I will try to describe the context of the implementation first. So a user within an existing system will want to hold a meeting about a given topic and will then create a room with a given name/identifier, they will then invite others into it and then it will basically be like a private chat room. So the steps I assume would be as the host, create a room and join it, and then send out invites which would require users to

SignalR event becomes intermittent when deployed to a server

和自甴很熟 提交于 2019-12-04 04:28:30
问题 When running locally through VS - IIS Express it all works fine 100%. When i then publish to a webserver (on network or online) I have some event stop firing for "OnConnected"... but not all the time. If i refresh it might then fire or it may not. The problematic event is ResetTimer, see below for example code. I have logging on and the console is not showing any errors. I am using signalr 1.0.1 <script type="text/javascript"> var timerTime, setIntervalInstance; $(function () { $('

SignalR Hub Overloads

假装没事ソ 提交于 2019-12-04 04:03:41
I tried creating a basic hub with two Receive methods, one accepts a string and the other an int. This causes an error stating that the method cannot be resolved. Commenting out one of the methods gets rid of the error and everything works. Is it possible to have overloads of a method in my hub? Could something like overloads be done? SignalR does support overloading server-side Hub methods, but the overloads must have a different arity, i.e. take a different number of arguments. If the overloads have the same arity, SignalR will be unable to resolve which overload is being called, even though

SignalR overwriting OnConnected(), OnDisconnected()

心不动则不痛 提交于 2019-12-04 03:55:54
I'm trying to overwrite OnConnected(), OnDisconnected() methods but I get: OnConnected()': no suitable method found to override Is implementing IDisconnect, IConnect interfaces and doing my processing within Connect() and Disconnect() the same as OnConnected(), OnDisconnected()? what gives? public static class UserHandler { public static HashSet<string> ConnectedIds = new HashSet<string>(); } public class MyHub : Hub { public override Task OnConnected() { UserHandler.ConnectedIds.Add(Context.ConnectionId); return base.OnConnected(); } public override Task OnDisconnected() { UserHandler

SignalR - Send message OnConnected

断了今生、忘了曾经 提交于 2019-12-04 03:34:16
I've been experimenting with SignalR today and It's really neat. Basically what I wanted to achieve is the following: As soon as a device connects it should send a message to the first one. If there are more devices than 1 connected I would like to send two messages. One to all except the last connected client. And one message to only the last connected client. The code I've been using works perfect when I place it in a custom API controller and basically call the action, but that's not what I want. I would like to send the messages as soon as a device connects within OnConnected without any

SignalR Negotiate 404

前提是你 提交于 2019-12-04 02:53:09
I am using SignalR 2.0. Everything works fine when running locally on my VS 2012. But when I publish the site on IIS, it breaks. The site loads but one of the scripts returns 404 Not Found. The script is something like. https://example.com/signalr/negotiate?xxx This path doesn't exist indeed. The correct path should be: https://example.com /private /signalr/negotiate?xxx Note the part in bold. Inside the WebSite ( https://example.com/ ) I have another Application ( https://example.com/private/ ). This one is using SignalR. This seems like a bug in SignalR since the signalr/hubs path is

SignalR in ASP.NET Core behind Nginx

天大地大妈咪最大 提交于 2019-12-04 02:50:31
I have a server with ubuntu 16.04, kestrel and nginx as a proxy server that redirects to localhost where my app is. And my app is on Asp.Net Core 2. I'm trying to add push notifications and using SignalR core. On localhost everything is working well, and on a free hosting with iis and windows as well. But when I deploy my app on the linux server I have an error: signalr-clientES5-1.0.0-alpha2-final.min.js?v=kyX7znyB8Ce8zvId4sE1UkSsjqo9gtcsZb9yeE7Ha10:1 WebSocket connection to 'ws://devportal.vrweartek.com/chat?id=210fc7b3-e880-4d0e-b2d1-a37a9a982c33' failed: Error during WebSocket handshake:

SignalR .NET Core camelCase JSON Contract Resolver

不羁岁月 提交于 2019-12-04 02:50:25
Using .NET Core RC2. Got SignalR working, but trying to get it returning camelCase properties in JSON. For APIs I'm using... services.AddMvc().AddJsonOptions(o => { o.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); }); Maybe there's just nothing in place yet for SignalR (after all, it's not even supposed to work yet...), but wondering if anyone's figured it out yet? I've tried a few things like... services.AddTransient<IContractResolver, CamelCasePropertyNamesContractResolver>(); ... but no go. Anyone got this working yet? Based on this issue from the