3

我开发了一个网络聊天应用程序,但遇到了一个奇怪的问题。该应用程序在我的本地机器上运行良好,但只是卡在远程机器上。

我完全迷路了,如何提供有关我的问题的线索(如果有追踪问题的技巧,请提出建议),我得到的唯一错误$.connection.hub.error

Protocol error: Unknown transport.

Description: 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. 

Exception Details: System.InvalidOperationException: Protocol error: Unknown transport.

Source Error: 

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.

Stack Trace: 

[InvalidOperationException: Protocol error: Unknown transport.]
   Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context) +866
   Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context) +174
   Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment) +628
   Microsoft.AspNet.SignalR.Owin.Handlers.HubDispatcherHandler.Invoke(IDictionary`2 environment) +222
   Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute() +55
   Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object extraData) +259

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result) +110
   Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.EndProcessRequest(IAsyncResult result) +7
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8836913
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

这是控制台日志提供的内容。

SignalR: Negotiating with '<root_url>/signalr/negotiate'. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to SSE endpoint '<root_url>/signalr/connect?transport=serverSentEv…2fc32a4&connectionData=%5B%7B%22name%22%3A%22xmppservicehub%22%7D%5D&tid=7' jquery.signalR-1.0.0-rc2.js:54
SignalR: EventSource timed out trying to connect jquery.signalR-1.0.0-rc2.js:54
SignalR: EventSource readyState: 0 jquery.signalR-1.0.0-rc2.js:54
SignalR: EventSource calling close() jquery.signalR-1.0.0-rc2.js:54
SignalR: This browser supports SSE, skipping Forever Frame. jquery.signalR-1.0.0-rc2.js:54
SignalR: SignalR: Initializing long polling connection with server. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr/connect?transport=longPolling&…fc32a4&connectionData=%5B%7B%22name%22%3A%22xmppservicehub%22%7D%5D&tid=10' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: Longpolling connected jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr?transport=longPolling&connecti…%7CS%2C1%7CT%2C0%7CQ%2C0&groups=%5B%22XmppServiceHub.howtodemo%22%5D&tid=2' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr?transport=longPolling&connecti…%7CR%2C0%7CS%2C1%7CT%2C0&groups=%5B%22XmppServiceHub.howtodemo%22%5D&tid=8' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: Attempting to connect to '<root_url>/signalr?transport=longPolling&connecti…%7CR%2C0%7CS%2C1%7CT%2C0&groups=%5B%22XmppServiceHub.howtodemo%22%5D&tid=5' using longPolling. jquery.signalR-1.0.0-rc2.js:54
SignalR: An error occurred using longPolling. Status = error. <html>
    <head>
        <title>Protocol error: Unknown transport.</title>

供参考:

我不知道如何提供任何线索,如果这些信息不够,请告诉我应该提供更多信息。

编辑

使用来自 nuget(版本 1.0.0)的最新库进行更新后,我得到了以下错误(仍然是相同的控制台日志,在本地机器上仍然可以正常工作,但在远程机器上)

[ObjectDisposedException]: The CancellationTokenSource has been disposed.

Server stack trace: 
   at System.Threading.CancellationTokenSource.ThrowIfDisposed()
   at System.Threading.CancellationTokenRegistration.Dispose()
   at Microsoft.AspNet.SignalR.Infrastructure.CancellationTokenExtensions.<>c__DisplayClass6`1.<SafeRegister>b__1()
   at Microsoft.AspNet.SignalR.Infrastructure.DisposableAction.Dispose(Boolean disposing)
   at Microsoft.AspNet.SignalR.Infrastructure.DisposableAction.Dispose()
   at Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.EndConnection(ConnectionMetadata metadata)
   at Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.AddConnection(ITrackingConnection connection)
   at Microsoft.AspNet.SignalR.Transports.LongPollingTransport.ProcessRequest(ITransportConnection connection)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
   at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
   at Microsoft.AspNet.SignalR.Owin.CallHandler.Invoke(IDictionary`2 environment)
   at Microsoft.AspNet.SignalR.Owin.Handlers.HubDispatcherHandler.Invoke(IDictionary`2 environment)
   at Microsoft.Owin.Host.SystemWeb.OwinCallContext.Execute()
   at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object extraData)

Exception rethrown at [0]: 
   at Microsoft.Owin.Host.SystemWeb.Utils.<>c__DisplayClass1.<GetRethrowWithNoStackLossDelegate>b__0(Exception ex)
   at Microsoft.Owin.Host.SystemWeb.Utils.RethrowWithOriginalStack(Exception ex)
   at Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result)
   at Microsoft.Owin.Host.SystemWeb.OwinHttpHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

提前致谢

4

2 回答 2

2

SignalR 不支持 < IIS 7。

编辑: 我们不支持 IIS < 7,但可以设置一些配置以支持它。

看起来您的应用程序正在运行,但您在https://github.com/SignalR/SignalR/issues/1549遇到了这个问题,它已在下一个版本中得到修复。

于 2013-02-27T07:25:23.507 回答
0

当您提供错误的集线器 URL 时,也会出现传输问题。即使您在 URL 末尾添加一个额外的正斜杠,也会出现此问题。

于 2013-04-05T12:13:13.577 回答