signalr

How to deploy a signal R self host server on azure web app

天涯浪子 提交于 2019-12-06 15:04:51
I am new to azure and I have an web app running on Azure web app and I have my signal-R self host as an console application. I want to deploy the signal r self host conbsole app to azure. What are the steps I need to take? @esther fang, please reference below tutorial, one thing need to be aware is, you will need to manually enable web socket for you site. http://www.asp.net/signalr/overview/deployment/using-signalr-with-azure-web-sites Quote: Deploying a SignalR Web App to Azure App Service SignalR doesn't add any particular complications to deploying an application to Azure versus deploying

SignalR 2.2.0 WebSocket error connecting to hub

心已入冬 提交于 2019-12-06 14:18:45
I have an ASP.Net MVC application that I have added SignalR to. After following the " Getting Started " tutorial (with modifications of course since it's going in my application) I got it working on localhost. However once it's in the production environment, I get the following error: WebSocket connection to 'ws://xxxxx/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=xxxxx' failed: Connection closed before receiving a handshake response. I can access /signalr/hubs (I get a js file). Any ideas as to why this would happen? André Pena This may be due to the fact that your

SignalR IAssemblyLocator override not firing

帅比萌擦擦* 提交于 2019-12-06 13:47:27
I have a simple app which uses several hubs, some in the same project and one in another class library, and everything is working fine. Now I want to try and load a hub that's been created at run-time using CSharpCodeProvider.CompileAssemblyFromSource, and have my client communicate with that hub. It's not showing up in /signalr/hubs/. As one of several things I'm trying to get working, I'm trying to use a custom IAssemblyLocator as described here: https://github.com/SignalR/SignalR/wiki/Extensibility But my GetAssemblies() code isn't being called as far as I can tell. This is my Global.asax

Azure Web Jobs and SignalR memory leak

送分小仙女□ 提交于 2019-12-06 13:17:02
So I have some webjobs that occasionally connect to a signalr hub and broadcast a message. Below is just an example of one, in this case its a simple web job for development with the TimerTrigger attribute that is set to run continuously every 20 seconds. Like that shown in the code below. public static void Main() { JobHostConfiguration config = new JobHostConfiguration(); config.Tracing.ConsoleLevel = TraceLevel.Verbose; config.UseTimers(); if (config.IsDevelopment) { config.UseDevelopmentSettings(); } var host = new JobHost(config); host.RunAndBlock(); } public static void ProcessPush(

Get names of Online users connected to a Server

[亡魂溺海] 提交于 2019-12-06 13:13:48
I am new to asp.net. I have gone through this link which has shown how to count the online users connected to a server using asp.net. ( which is working when I tried ) My question is: What should I change in that code (Global.asax) so that It shows all the names of the connected users instead of counting them. I created a chat application which stores the name of the connected user in a variable chatUsername in js file as shown below: js file var chatUsername = window.prompt("Enter Username:", ""); // chat.client.addMessage = //Function // chat.server.send(chatUsername); .aspx.cs file //Using

SignalR Join Group From Controller

∥☆過路亽.° 提交于 2019-12-06 13:00:41
问题 When the user logs in on my site, they select from a dropdown which group they belong to. On the login postback, as they are logged in, I'd like to assign them to the correct SignalR group. As per the documentation here, I can join it client-side via: contosoChatHubProxy.server.joinGroup(groupName); Is there a way to assign the group from the controller? I can call the Hub like: var hub = new NotificationHub() hub.JoinGroup(selectedGroup); but the Context in the hub method is null. Is this

Signalr IConnectionIdGenerator not found in SignalR 1.0rc2 release

耗尽温柔 提交于 2019-12-06 11:28:32
I used to implement my own connection id generator with the following code: public class MyConnectionFactory : IConnectionIdGenerator { public string GenerateConnectionId(IRequest request) { return MyUserManager.Instance.CurrentUserID.ToString(); } } This was working fine with SignalR 0.5.3 release but after updating to SignalR 1.0rc2 release the namespace or class name is not found. Also, I am not able to find any note on this breaking change here https://github.com/SignalR/SignalR/blob/master/ReleaseNotes.md Can you help me fixing this issue? This is gone indeed and there is no direct

SignalR not working on production server

只谈情不闲聊 提交于 2019-12-06 11:13:01
I am tring to utilize a simple SignalR sample and from a reason I get the 404 code from the following - <script src="<%= ResolveUrl("~/signalr/hubs") %>" type="text/javascript"></script> I checked the SignalR documentation and changed my web.config according to what is suggests there still I get that 404 status code. my code follows - Web.Config: <configuration> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> </compilation> <httpRuntime/> <

Ignoring a client when broadcasting a message with SignalR

折月煮酒 提交于 2019-12-06 10:24:27
I want to ignore the client that made the request to broadcast the message my web app. The only way I can seem to do this is by caching the connectionId of the current user: public class BroadcastHub : Hub { public override Task OnConnected() { System.Runtime.Caching.MemoryCache.Default.Set(HttpContext.Current.User.Identity.Name + "-connectionId", Context.ConnectionId, new CacheItemPolicy() { Priority = CacheItemPriority.Default, SlidingExpiration = TimeSpan.FromHours(1), AbsoluteExpiration = MemoryCache.InfiniteAbsoluteExpiration }); return base.OnConnected(); } public override Task

signalr client hub events not being triggered within a jquery .ready() method

限于喜欢 提交于 2019-12-06 10:11:55
问题 I have found that the function within a signalr client hub method is not always triggered when enclosed within a jquery .ready() method. For example this does not always work: $(function(){ hubname.client.methodName = function () { //do something } }) whereas the following works reliably: hubname.client.methodName = function () { //do something } can anyone explain this to me? This pattern of behaviour is not constant, and occurs for me in both chrome and internet explorer. 来源: https:/