signalr

SignalR cookies not sent from client

☆樱花仙子☆ 提交于 2019-12-04 19:22:30
I have a cookie which is sent from the client which is used as part of my MVC web service, however now that I have integrated a hub into this application the hub doesnt get sent the cookie, whereas the mvc app does. Now after reading other similar questions (not that there are many) the cookies domain seems to be to blame, or the path is not set. Currently my system has 2 web apps, the ui and service. In my dev environment it is like so: Service http://localhost:23456/<some route> UI http://localhost:34567/<some route> So in the above example, the ui will send a query to the service, getting

SignalIR and KnockoutJS in Asp.Net Web Form

◇◆丶佛笑我妖孽 提交于 2019-12-04 17:38:35
I seen may samples of SignalIR and KnockoutJS samples on MVC platform but not on WebForm. Please suggest me, can we use on WebForm? Any articles link would be appreciable. I know this is exactly a month late but here's a quick example [this is a trivial example that i have built from exploring MVC examples ] lets say u have a page called MyPage in the .aspx file write the following: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

.NET Scalable Pub/Sub service implementation

我的未来我决定 提交于 2019-12-04 17:17:24
I need to build a system that is similar to a pub/sub system. It is composed of multiple sub-systems or services running in separate executables or as a Windows Services. The sub-systems are: The pub/sub service A pub/sub service managing communications between the internal sub-systems and the users. A user can have multiple channels open (A web page connected to a SignalR service, a mobile device connected to a duplex WCF service, etc.). The service should manage all the channels of an user and be able to send information to them on demand based on topics or specific users. The service must

SignalR hub method parameter serialization

大兔子大兔子 提交于 2019-12-04 17:11:31
问题 I would need some guidelines from SignalR developers what is the best way to tweak HUB method's parameters serialization. I started migrating my project from WCF polling duplex (Silverlight 5 - ASP.NET 4.5) to SignalR (1.1.2). The message (data contract) is polymorphic based on interfaces. (Like IMessage, MessageA : IMessage, etc. - there is actually hierarchy of interfaces implemented by classes but it is not of much significancy for the question). (I know polymorphic objects are not good

SignalR: Hub OnConnected not called if no client methods

。_饼干妹妹 提交于 2019-12-04 17:09:45
问题 I am writing a game in SignalR. The idea is that you connect with your laptop, which will be used as "display" and then you connect with your smart phone and that will be used as "joystick". The entire setup works very well. Now that it all works, I decided to refactor the code. I realized that the relationship between the joystick and the display is one way (the display never needs to send information back to the joystick). Therefore I decided that I did not need any signalR invokable client

Entity Framework “Unexpected Connection State” Exception

送分小仙女□ 提交于 2019-12-04 16:55:34
问题 After three hours of debugging and searching, I'm hoping someone here has an answer. Entity Framework (using MySQL) throws the following exception if I call the following function quickly in succession (e.g. < 0.1 seconds apart). System.InvalidOperationException: Unexpected connection state. When using a wrapping provider ensure that the StateChange event is implemented on the wrapped DbConnection. However, sometimes the function works without any problems. The exception is thrown on the

How to pass complex objects via SignalR?

那年仲夏 提交于 2019-12-04 16:52:38
问题 There is an excellent tutorial on SignalR that explains how to pass .NET objects as parameters to Javascript and vice versa. In that case it passes a ChatMessage object to and from. However, the tutorial addresses a really simple object. I'd like to see how to deal with complex .NET objects (that have other objects as properties) in Javascript. For instance, consider the following object: class Master { public List<QuarterHour> QuarterHours { get; set; } public List<string> Books { get; set;

SignalR groups - filtering handled on client or server?

二次信任 提交于 2019-12-04 16:50:21
问题 I've been reading a decent amount regarding SignalR hubs and groups. In particular, I've noticed that you cannot get a count of the connections in a particular group. Is the filtering for groups handled on the client or server? If the server, why can't SignalR expose a count? If on the client, is there a way to send messages only to particular clients? 回答1: When you send a message to a particular group of specific connection, filtering happens on the server (there's no filtering, you're just

Ways to mock SignalR Clients.Group in unit test

杀马特。学长 韩版系。学妹 提交于 2019-12-04 16:29:51
I'm writing mock test cases for SignalR application. I just started with the help of Unit Testing SignalR Applications , but my requirement is little bit different that example shown there. Following is the code I have done after googling. SignalRHub public class HubServer : Hub { [HubMethodName("SendNofication")] public void GetNofication(string message) { try { Clients.Group("Manager").BroadCast(message); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } Unit Test public interface IClientContract { } [TestMethod] public void GetNoficationTest() { var hub = new HubServer(); var

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

醉酒当歌 提交于 2019-12-04 16:05:33
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://stackoverflow.com/questions/45925309/signalr-client-hub-events-not-being-triggered-within-a-jquery-ready