当我使用带有信号器GlobalHost.DependencyResolver.UseSqlServer
的sqlserver scaleout时,它无法连接到LongPolling
或serverSentEvents
传输。
之前有人遇到此错误,我正在使用signalr 2.2.1
和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.AspNet.SignalR.Hubs.IAssemblyLocator), () => new AssemblyLocator());
EventSource已连接:
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.