how to get SignalR user connection id out side the hub class?
Yep. You can use $.connection.hub.id.
Yep. You can use $.connection.hub.id.
Roll your own Conttract resolver like public class SignalRContractResolver : IContractResolver { private readonly Assembly assembly; private readonly IContractResolver camelCaseContractResolver; private readonly IContractResolver defaultContractSerializer; public SignalRContractResolver() { defaultContractSerializer = new DefaultContractResolver(); camelCaseContractResolver = new CamelCasePropertyNamesContractResolver(); assembly = typeof(Connection).Assembly; } public JsonContract ResolveContract(Type type) { if (type.Assembly.Equals(assembly)) { return defaultContractSerializer.ResolveContract(type); } return camelCaseContractResolver.ResolveContract(type); } } Register … Read more
I got the same problem today. Your answer pointed me in the right direction, because I had the EXACT same setup for script loading. I had all my script tags on the top of the page (head) in the following order. JQuery SignalR /signalr/hubs my-script.js And of course, the @Layout.cshtml was so thoughtful to add … Read more
I was able to solve this by using $http_connection instead of keep-alive or upgrade server { server_name example.com; location / { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } I did this because SignalR was also trying to use POST and GET requests to my hubs, … Read more
Here, this is what I use in Controllers for ajax, I modified it a bit so it can be called from method instead of controller, method returnView renders your view and returns HTML string so you can insert it with JS/jQuery into your page when you recive it on client side: public static string RenderPartialToString(string … Read more
Now is possible with Postman version > 8.0 using WebSocket Request block. You can grab the information in their blog post https://blog.postman.com/postman-supports-websocket-apis/
SignalR doesn’t guarantee message delivery. Since SignalR doesn’t block when you call client methods, you can invoke client methods very quickly as you’ve discovered. Unfortunately, the client might not always be ready to receive messages immediately once you send them, so SignalR has to buffer messages. Generally speaking, SignalR will buffer up to 1000 messages … Read more
Is SignalR suitable for windows desktop applications (winforms/wpf)? The answer from signalr.net is: SignalR can be used to add any sort of “real-time” web functionality to your ASP.NET application. (As stated correctly by others it can be self-hosted, so no need for IIS) So the answer seems to be no. It is a server side … Read more
This is coming from the browser link feature in Visual Studio 2013 in the Standard toolbar. It is code that allows Visual Studio to interact with browsers running the code, and should only show up when running it in debug mode. To disable it (until the fix to the issue is made live in an … Read more
You can have multiple hubs sharing one connection on your site. SignalR 2.0 was updated to handle multiple hubs over one signlar connection with no lost in performance. Official docs: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server#multiplehubs All clients will use the same URL to establish a SignalR connection with your service (“/signalr” or your custom URL if you specified one), … Read more