views:

28

answers:

2

Dear all,

Actually I don't know whether my question is related to this thread.

I want to create a web application using ASP.NET MVC 2.

For simplicity, let my scenario be as follows:

A visitor is allowed to submit a text file and get a pdf output from the server.

There is an Adobe-Acrobat-like application, that can convert text to pdf, running on my server.

My question is how to execute the converter such that each visitor submitting files cannot interfere with others?

Should I make an instance of the converter for each visitor?

Thank you in advance.

regards, yoyo

A: 

Well, that all depends on the capabilities of your converter component and its API. How do you inoke the conversion process? Is it a .NET assembly or some external process you are communicating with?

ASP.NET can help you as it contains the following concepts:

  • Each request is executed in a seperate thread with its own context
  • You can use sessions to associate multiple requests with the user that originated them
marcind
My real scenario is as follows:I want to allow users to enter math expressions into my site. The server then processes them by calling MAXIMA kernel running on the same server.http://calc.matthen.com/ is an example developed by other.Steps to establish communication with maxima kernel:1. create an socket application listening on a port. 2. connect maxima (as a client) to the application. I have created the listening application in Windows Form mode. It works and I want to make it work in ASP.NET mode.What modification should I do? Convert it to console application?
xport
+1  A: 

It depends upon your requirements, whether you want to execute it synchronously or async way. If its synchronous process then ASP.Net executes each request in a separate thread so you dont have to worry.So it will not interfere with others. If its async process then you may want to write windows service which will run in backgound to execute each request of the user.

lucene user
Thank Lucene user for your response. After doing some trial and errors, it seems the external assembly must work asynchronously. If I create a windows service, how to associate each assembly instance with the user?
xport