My project is an ASP.NET MVC 4 project.
It works fine on localhost when I host it on Azure I get a timeout on ajax calls that take more than 4 minutes. I am sure that the problem is with azure because it does not matter what I do on the server. even just set Thread.sleep(300000) I get a timeout.
I read: https://azure.microsoft.com/en-us/blog/new-configurable-idle-timeout-for-azure-load-balancer/ This
It is common practice to maintain an active connection for a longer period to use TCP Keep-alive
and there is no other option for web applications. Therefore, I assume that I need help to maintain code in asp.net. I canβt figure it out myself. I tried to send a simple ajax call to the server every minute, and this does not help me, so I tried to use TcpKeepAlive as follows:
public JsonResult MyLongOperation() { HttpWebRequest request =(HttpWebRequest)WebRequest.Create("mySite"); request.Proxy = null; request.ServicePoint.SetTcpKeepAlive(true, 30000, 5000); Thread.Sleep(300000);
Doesn't work, I need help!
source share