如何将访问 Web 应用程序的每个用户与服务分配的单独的临时进程关联起来?
我想使用在 IIS 上运行的 ASP.NET 开发一个 Web 应用程序。
如果用户提交 MAXIMA 输入命令,后面的代码将要求自定义 Windows 服务创建一个新的不同临时进程来执行外部程序集。
更准确地说,只有一个 Windows 服务为所有用户提供服务,但每个用户都将与一个运行外部程序集的不同的临时进程相关联。
Windows 服务包含侦听某个端口的单个套接字和用于通信的异步套接字列表。列表中的每个套接字都将与运行外部程序集的不同临时进程通信,该程序集充当客户端套接字。
请注意:我使用进程而不是应用程序域,因为外部程序集是批处理文件(不是托管程序集)。
我的问题是:
- 如何从代码隐藏调用Windows服务?
- 如何将每个用户与一个独特的临时进程相关联?
- 如果同时工作的用户越来越多,如何提高可扩展性?
- 如果用户输入的 Maxima 输入命令导致进程长时间运行,通知用户进度的明智方法是什么?
以下链接为您提供有关我的项目的更多详细信息: https:// sourceforge.net/projects/aspmaxima/forums/forum/1190702/topic/3786806
提前谢谢您。
I want to develop a web application using ASP.NET running on IIS.
If a user submits a MAXIMA input command, the code behind will ask a custom windows service to create a new distinct temporary process executing an external assembly.
More precisely, there is only one windows service serving for all users, but each user will be associated with a distinct, temporary process running an external assembly.
The windows service contains a single socket listening on a certain port and a list of asynchronous sockets for communication. Each socket of the list will communicate with a distinct, temporary process running an external assembly which works as a client socket.
Note that: I use a process rather than an application domain because the external assembly is a batch file (not managed assembly).
My questions are:
- How to call windows service from code behind?
- How to associate each user with a distinct, temporary process?
- How to improve scalability if there are more and more users working simultaneously?
- If the Maxima input command entered by a user cause long-running process, what is the wise way to notify the user about the progress?
The following link provide you with more detail about my project: https://sourceforge.net/projects/aspmaxima/forums/forum/1190702/topic/3786806
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应该在 MVC 应用程序中使用代码隐藏。
与非托管代码互操作时的可扩展性很困难。唯一明智的方法是分解问题。
You should not be using codebehind in an MVC app.
Scalability while interoprating with unmanaged code is hard. The only sane way to do this is to decompose the problem.