1

当我将 sqlserver scaleout 与 signalr 一起使用时GlobalHost.DependencyResolver.UseSqlServer,它无法连接LongPollingserverSentEvents传输。

以前任何人都遇到过这个错误,我正在使用signalr 2.2.1and signalr.sqlserver 2.2.1

这是我在 owin 启动类中的完整代码

 GlobalHost.Configuration.TransportConnectTimeout = TimeSpan.FromSeconds(30); 
    string sqlConnectionString = "Server=NCBCDEV;Database=SignalR2;Integrated 
    Security=true"; SqlScaleoutConfiguration sqlcon = new 
    SqlScaleoutConfiguration(sqlConnectionString); 
    GlobalHost.DependencyResolver.UseSqlServer(sqlcon ); app.MapSignalR(); 
    GlobalHost.DependencyResolver.Register(typeof(Microsoft.AspN‌​et.SignalR.Hubs.IAss‌​emblyLocator), () => new AssemblyLocator()); 

事件源已连接:

13:59:38.277 :82/signalr/hubs/connect?transport=serverSentEvents&clientProtocol=1.5&conn…48Kldg%3D%3D&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D&tid=0:1 GET http://ncbcdev:82/signalr/hubs/connect?transport=serverSentEvents&clientPro…zC48Kldg%3D%3D&connectionData=%5B%7B%22name%22%3A%22chathub%22%7D%5D&tid=0 net::ERR_CONNECTION_RESET
13:59:38.278 
SignalR: serverSentEvents transport failed to connect. Attempting to fall back.
longPolling transport starting.
SignalR: longPolling transport failed to connect. Attempting to fall back.
13:59:52.655 jquery.signalR-2.2.1.min.js:9 [13:59:52 GMT+0300 (Arab Standard Time)] SignalR: Fallback transports exhausted.
4

0 回答 0