如何保持TCP / IP套接字在IIS打开? [英] How do I keep TCP/IP socket open in IIS?

查看:472
本文介绍了如何保持TCP / IP套接字在IIS打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的使用场景:到ASP.NET应用程序的用户登录;在某些时候,使远程TCP / IP服务器的连接。服务器的响应可能会显著延迟之后(例如,几个小时)。试想一下,用户提交批处理作业,作业可能运行很长一段时间。因此,用户可以关闭浏览器,得到一些咖啡,回来后看到的结果。

I have the following use scenario: User logs in to ASP.NET application; and at some point makes a connection to remote TCP/IP server. The server's response may come after significant delay (say, a few hours). Imagine that the user submits a batch job, and the job may be running for a long time. So, the user may close the browser, get some coffee and come back to see the results later.

但是,如果客户机关闭连接,服务器将的从不的返回结果。所以,在应用程序对象保持插座的信息将无法正常工作 - 当用户关闭浏览器,它消失了。

However, if client closes the connection, the server will never return the results. So, keeping Socket info in Application object won't work - once user closes the browser, it goes away.

是否有任何其他的方式来坚持这个开放的插座,而IIS是吗?此外,如果在第二用户登录时,我会preFER使用相同的连接。最后,我认识到,解决方案是脆性的,并且它可以偶尔断裂。这是确定的。

Is there any other way to persist this open socket while IIS is up? Also, if the second user logs in, I would prefer to use the same connection. Finally, I realize that the solution is brittle, and it may occasionally break. It's OK.

远程服务器是20岁的大型机应用;所以没有机会更改那里。只要用户不退出 - 目前一切工作正常。一切都在局域网上,所以没有路由问题使局势复杂化。

Remote server is 20-year old mainframe application; so no chance for changes there. And as long as the user doesn't log out - everything is working fine now. Everything is on the LAN, so there are no routing issues to complicate the situation.

推荐答案

应用程序字典中的内容,当用户注销时也不会丢失。你的计划将工作(在一个易碎的方式,但你说这是确定)。

The contents of the application dictionary are not lost when a user logs out. Your scheme will work (in a brittle way, but you say that's ok).

请注意,该工作进程可以退出的原因有很多,所以我们期待在任意时刻被杀死。

Note, that worker processes can exit for many reasons, so expect to be killed at arbitrary points in time.

这篇关于如何保持TCP / IP套接字在IIS打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆