Long polling Stop other request for 1 or 2 minutes

前端 未结 4 1884
你的背包
你的背包 2021-01-15 04:03

During create a chat system , I use a long life request to get message , and use a jquery request to send message like this :

*Send: *

$(\"         


        
4条回答
  •  北恋
    北恋 (楼主)
    2021-01-15 04:20

    Since you wrote in a comment that you are using Session state in the application, it's likely correct that the long running request is blocking the update.

    The reason is that Asp.Net blocks concurrent access to the Session. See this link on MSDN for details. Specifically (close to the bottom of the page):

    However, if two concurrent requests are made for the same session (by using the same SessionID value), the first request gets exclusive access to the session information. The second request executes only after the first request is finished.

    One way to fix it might be to set EnableSessionState="ReadOnly" or EnableSessionState="False" on the page in question. This assuming that you don't need access to the Session in the particular page with the chat system.

提交回复
热议问题