簡體   English   中英

SignalR 待處理的請求在 IIS

[英]SignalR pending Request In IIS

我們有一個帶有 .NET 5 MVC 的 web 應用程序,在驗證過程之后,我們打開 signalR 連接。

當我們通過復制瀏覽器實例加載相同的頁面時,用戶的 rest 獲取結構並且應用程序停止響應。 其他用戶也無法使用應用程序。

在 IIS -> 工作進程中查看當前正在處理的請求時,它會顯示所有掛起的連接請求,打開的瀏覽器實例經過了很長時間。

一旦我們關閉瀏覽器選項卡,應用程序就會開始為其他用戶工作。

請提出相同的解決方案。

找到下面提到的代碼

  var startConnection = function () {

    var signalRConnId = '';

    if (sr_connection == null && spGeneral.useSignalR) {

        sr_connection = new signalR.HubConnectionBuilder().withUrl("/SignalRHub").withAutomaticReconnect().build();
        
        return sr_connection.start().then(function () {

            signalRConnId = sr_connection.connection.connectionId;

            console.log('Signal R Connection Id : ' + signalRConnId);
            console.log('Signal R Started');

            return sr_connection;

        }).catch(function (err) {

            console.error('Signal R Notification Error: ' + err.toString());

        });
    }
    else {
        return sr_connection
    }
}

服務器代碼

public Task SendNotificationAsync(string subcriber,object data) 
{ 
    return _hub.Clients.All.SendAsync(subcriber, data); 
}

It was a problem of windows 10 with IIS 10. We shifted our web app deployment to windows server 2016. So it got resolved.

Window 10 似乎有問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM