Signalr 从Visual Studio运行一段时间后,信号器连接将自动停止

Signalr 从Visual Studio运行一段时间后,信号器连接将自动停止,signalr,Signalr,我有一个网页,使用SignalR在JqGrid中显示最新的数据集。每当修改数据时,所有连接的客户端都会使用更新的数据重新加载jQGrid 一切正常,但我注意到页面在一段时间后(即大约一分钟后)停止刷新数据。浏览器中的状态栏几乎每秒都在快速运行。如果我通过执行F5刷新页面,那么grid将开始刷新数据,但一段时间后会停止 此外,我还意识到,无论我在ReconnectionTimeout参数中设置了什么值,我的网格都只会刷新该时间段的数据,然后停止 我的出发点如下: var config = AspN

我有一个网页,使用SignalR在JqGrid中显示最新的数据集。每当修改数据时,所有连接的客户端都会使用更新的数据重新加载jQGrid

一切正常,但我注意到页面在一段时间后(即大约一分钟后)停止刷新数据。浏览器中的状态栏几乎每秒都在快速运行。如果我通过执行F5刷新页面,那么grid将开始刷新数据,但一段时间后会停止

此外,我还意识到,无论我在ReconnectionTimeout参数中设置了什么值,我的网格都只会刷新该时间段的数据,然后停止

我的出发点如下:

var config = AspNetHost.DependencyResolver.Resolve<IConfigurationManager>();
            config.ReconnectionTimeout = TimeSpan.FromSeconds(60);
对上述请求的响应

GET http://localhost.:2629/AlarmPoc/signalr?transport=foreverFrame&connectionId=600dda9b-225f-42ef-a8f3-79008bf6faaf&connectionData=%5B%7B%22name%22%3A%22YW.AlarmPoC.Web.SignalR.AlarmHub%22%2C%22methods%22%3A%5B%22notification%22%5D%7D%5D&messageId=2&frameId=1
302 Found to /AlarmPoc/signalr/
HTTP/1.1 302 Found
Server: ASP.NET Development Server/10.0.0.0
Date: Mon, 30 Apr 2012 13:05:00 GMT
Content-Length: 135
Location: /AlarmPoc/signalr/
Connection: Close

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href='/AlarmPoc/signalr/'>here</a>.</h2>
</body></html>
响应

HTTP/1.1 500 Internal Server Error
Server: ASP.NET Development Server/10.0.0.0
Date: Mon, 30 Apr 2012 13:05:00 GMT
X-AspNet-Version: 4.0.30319
Cache-Control: private
Content-Type: text/html; charset=utf-8
Connection: Close

<html>
    <head>
        <title>Unknown transport.</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/AlarmPoc' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Unknown transport.</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

            <br><br>

            <b> Exception Details: </b>System.InvalidOperationException: Unknown transport.<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Stack Trace:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

[InvalidOperationException: Unknown transport.]
   SignalR.PersistentConnection.ProcessRequestAsync(HostContext context) +329
   SignalR.Hubs.HubDispatcher.ProcessRequestAsync(HostContext context) +203
   SignalR.Hosting.AspNet.AspNetHost.ProcessRequestAsync(HttpContextBase context) +433
   SignalR.Hosting.AspNet.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +125
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8967220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +184
</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <hr width=100% size=1 color=silver>

            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

            </font>

    </body>
</html>
<!-- 
[InvalidOperationException]: Unknown transport.
   at SignalR.PersistentConnection.ProcessRequestAsync(HostContext context)
   at SignalR.Hubs.HubDispatcher.ProcessRequestAsync(HostContext context)
   at SignalR.Hosting.AspNet.AspNetHost.ProcessRequestAsync(HttpContextBase context)
   at SignalR.Hosting.AspNet.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->

版本信息:Microsoft.NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319.272
Signal在指定的重新连接超时后自动重新连接,默认值为110秒。如果连接完全停止,则会出现其他问题,信号器将永远重试。您能否运行fiddler并尝试重现问题(顺便说一句,打开流媒体模式)?这很可能是您网络中的某个网络设备或IE8信号器中的一个错误。它会与其他浏览器重新编程吗?您好@dflower,当我从Visual Studio运行时,这个问题正在发生。从IIS它工作得很好。我已经在各种浏览器上测试过它,如IE8/9、Firefox、Chrome,当从VS运行时,所有浏览器都会出现错误。我使用fiddler跟踪它,这表明SignalR遇到了异常。我正在用小提琴手的堆栈跟踪更新我的问题。请提出建议。您使用的是IIS Express还是Visual Studio开发服务器(Cassini)?@Andy,我使用的是Cassini(带SP1的VS2010)。这就是遇到“对象移动到此处错误”的地方。在iis7.5上,它工作正常。请建议..您可以右键单击项目并选择“使用IIS Express”吗?在指定的重新连接超时后,SignalR将自动重新连接,默认值为110秒。如果连接完全停止,则会出现其他问题,信号器将永远重试。您能否运行fiddler并尝试重现问题(顺便说一句,打开流媒体模式)?这很可能是您网络中的某个网络设备或IE8信号器中的一个错误。它会与其他浏览器重新编程吗?您好@dflower,当我从Visual Studio运行时,这个问题正在发生。从IIS它工作得很好。我已经在各种浏览器上测试过它,如IE8/9、Firefox、Chrome,当从VS运行时,所有浏览器都会出现错误。我使用fiddler跟踪它,这表明SignalR遇到了异常。我正在用小提琴手的堆栈跟踪更新我的问题。请提出建议。您使用的是IIS Express还是Visual Studio开发服务器(Cassini)?@Andy,我使用的是Cassini(带SP1的VS2010)。这就是遇到“对象移动到此处错误”的地方。在iis7.5上,它工作正常。请建议..您可以右键单击您的项目并选择“使用IIS Express”吗?
HTTP/1.1 500 Internal Server Error
Server: ASP.NET Development Server/10.0.0.0
Date: Mon, 30 Apr 2012 13:05:00 GMT
X-AspNet-Version: 4.0.30319
Cache-Control: private
Content-Type: text/html; charset=utf-8
Connection: Close

<html>
    <head>
        <title>Unknown transport.</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Lucida Console";font-size: .9em}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/AlarmPoc' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Unknown transport.</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

            <br><br>

            <b> Exception Details: </b>System.InvalidOperationException: Unknown transport.<br><br>

            <b>Source Error:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Stack Trace:</b> <br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

[InvalidOperationException: Unknown transport.]
   SignalR.PersistentConnection.ProcessRequestAsync(HostContext context) +329
   SignalR.Hubs.HubDispatcher.ProcessRequestAsync(HostContext context) +203
   SignalR.Hosting.AspNet.AspNetHost.ProcessRequestAsync(HttpContextBase context) +433
   SignalR.Hosting.AspNet.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +125
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8967220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +184
</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <hr width=100% size=1 color=silver>

            <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

            </font>

    </body>
</html>
<!-- 
[InvalidOperationException]: Unknown transport.
   at SignalR.PersistentConnection.ProcessRequestAsync(HostContext context)
   at SignalR.Hubs.HubDispatcher.ProcessRequestAsync(HostContext context)
   at SignalR.Hosting.AspNet.AspNetHost.ProcessRequestAsync(HttpContextBase context)
   at SignalR.Hosting.AspNet.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->