signalr

Signalr - It's possible to wait reponse from client?

泪湿孤枕 提交于 2020-07-05 11:44:05
问题 I am a beginner in using Signalr and am checking out some examples. Is it possible to send a message to the client from the server and wait for a return from it? Or is it possible to guarantee that after the answer the same session will be used? My question is because in a given process, within a transaction, I need to ask the user if he wants to continue with the changes. I have not been able to ask this question before because validations should be done in the same session where changes

Ninject with Web Api, SignalR, MVC and OWIN

拟墨画扇 提交于 2020-06-27 11:28:29
问题 I am using a Ninject DI in my web application with a bunch of technoligies from Asp.Net stack (MVC, Web Api 2, SignalR). I have managed to make DI work for all technologies in use with the following approach: public static class NinjectWebCommon { private static readonly Bootstrapper bootstrapper = new Bootstrapper(); /// <summary> /// Starts the application /// </summary> public static void Start() { DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); DynamicModuleUtility

Invoking SignalR Hub not working for Asp.Net Core Web API

泪湿孤枕 提交于 2020-06-27 09:10:29
问题 I'm a newb to SignalR. I'm trying to set up a Asp.Net Core WebAPI so that other clients can connect to it using SignalR and get real-time data. My Hub class is: public class TimeHub : Hub { public async Task UpdateTime(string message) { await Clients.All.SendAsync("ReceiveMessage", message); } } I have a relay class as follows: public class TimeRelay : ITimeRelay { private readonly IHubContext<TimeHub> _timeHubContext; public TimeRelay(IHubContext<TimeHub> context) { _timeHubContext = context

How to import SignalR in React Component?

落花浮王杯 提交于 2020-06-22 19:35:26
问题 I have used create-react-app to scaffold the initial react application. My DashBoard component: import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import $ from 'jquery'; import 'signalr'; class Dashboard extends Component { constructor(props) { super(props); var connection = $.hubConnection('http://[address]:[port]'); var proxy = connection.createHubProxy('[hubname]'); // atempt connection, and handle errors connection.start() .done(function(){ console.log(

Error: Failed to complete negotiation with the server: Error: Not Found

不羁的心 提交于 2020-06-17 15:51:38
问题 I'm using SignalR with ASP.NET Boilerplate .NET Core 3.1 but I encounterd this problem Error: Failed to complete negotiation with the server: Error: Not Found How could I resolve this problem without skip negotiate (solution mentioned here ) zone-evergreen.js:2845 POST http://localhost:21021/signalr/negotiate?enc_auth_token=wNYmO41%2F Show 162 more frames signalr.min.js:16 [2020-06-07T10:17:31.634Z] Error: Failed to start the connection: Error: Not Found here is Angular Code: ngOnInit(): void

Second WebBrowser control with SignalR freezes javascript

女生的网名这么多〃 提交于 2020-06-16 20:33:19
问题 In my WinForm application, I have a "main" .net WebBrowser control with the following JS: var $hub; $(function () { $hub = $.connection.sendHub; $.connection.hub.stateChanged(connectionStateChanged); $.connection.hub.disconnected(function () { setTimeout(function () { $.connection.hub.start(); }, 10000); }); $hub.client.broadcastMessage = function (action, argument, tag) { // Do something }; $.connection.hub.start({ waitForPageLoad: false }).done(function () { }); function

Second WebBrowser control with SignalR freezes javascript

风流意气都作罢 提交于 2020-06-16 20:33:09
问题 In my WinForm application, I have a "main" .net WebBrowser control with the following JS: var $hub; $(function () { $hub = $.connection.sendHub; $.connection.hub.stateChanged(connectionStateChanged); $.connection.hub.disconnected(function () { setTimeout(function () { $.connection.hub.start(); }, 10000); }); $hub.client.broadcastMessage = function (action, argument, tag) { // Do something }; $.connection.hub.start({ waitForPageLoad: false }).done(function () { }); function

Blazor - Compare Previous and Next State

て烟熏妆下的殇ゞ 提交于 2020-06-15 07:10:16
问题 I have a table of students in Blazor, which is coming from an api, and I am also receiving a pushed data to update the students info which is basically the score upon a change in the database, the push is working fine and the score is being updated but I also want to change the background colour of the field that has been updated in the table upon a change in the score to red just the td tag for few sec, my code is as follow: @foreach(var student in SS.GetStudents()){ <tr> <td> student.name <

Blazor - Compare Previous and Next State

自作多情 提交于 2020-06-15 07:10:08
问题 I have a table of students in Blazor, which is coming from an api, and I am also receiving a pushed data to update the students info which is basically the score upon a change in the database, the push is working fine and the score is being updated but I also want to change the background colour of the field that has been updated in the table upon a change in the score to red just the td tag for few sec, my code is as follow: @foreach(var student in SS.GetStudents()){ <tr> <td> student.name <

Blazor Client Side Signalr not working when Hosting to IIS

回眸只為那壹抹淺笑 提交于 2020-05-31 05:43:29
问题 Is there any one who can point me in the right direction? When hosting my Blazor Client Side application to IIS the signalr is not working. In visual studio with IIS express it work as expected. I did setup IIS and deployed the application as indicated in the Microsoft documents. There is no console errors and the hub returns status code 200 when hosting in IIS. Thank you in advance 回答1: Websocket support is not enabled by default on IIS. It was introduced in IIS 8, and has to be enabled from