是否有可能拥有一个与其他 MVC.net 应用程序通信的 ASP.NET MVC 服务器? (示例显示在图片链接中)
客户端首先与主服务器通信。主服务器将他的请求重定向到其他服务器之一。客户端不能直接与其他服务器通信。它应该始终通过主服务器。
所以当用户请求 MainServer.com 时
MainServer 会将用户定向到以下任一项:
S1.MainServer.com
S2.MainServer.com
S3.MainServer.com
注意 S1、S2 和 S3 在物理上彼此分开。
最佳答案
试试这个:
public ActionResult Index()
{
if (!S1.Server.IsBusy())
{
return new RedirectResult("http://S1.MainServer.com");
}
else if(!S2.Server.IsBusy())
{
return new RedirectResult("http://S2.MainServer.com");
}
else if (!S3.Server.IsBusy())
{
return new RedirectResult("http://S3.MainServer.com");
}
else return View();
}
关于c# - 如何将多个 MVC.net 应用程序与其他 MVC.net 应用程序连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41975521/