我正在研究signalR项目,我想按照官方文档中的步骤使用redis扩展信号器。问题是当我只使用signalr时,应用程序工作正常:signalr客户端正在发送三个请求到服务器 - 协商,连接和启动但添加此行时: " hubConfiguration.Resolver.UseRedis(new RedisScaleoutConfiguration(" localhost",6379,string.Empty," MyApp"))"在我的启动中,信号器客户端仅发送negociate并连接响应状态代码:200但不发送启动请求。我的statrtup如下所示:
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll);
HubConfiguration hubConfiguration = new HubConfiguration();
hubConfiguration.EnableDetailedErrors = true;
hubConfiguration.EnableJavaScriptProxies = false;
hubConfiguration.EnableJSONP = true;
GlobalHost.Configuration.TransportConnectTimeout =
TimeSpan.FromSeconds(10);
hubConfiguration.Resolver.UseRedis(new
RedisScaleoutConfiguration("localhost", 6379, string.Empty,
"TrainApp"));
map.RunSignalR(hubConfiguration);
});
}
}