Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I create a web app to run a legacy dos app.

Status
Not open for further replies.

yongbum

Programmer
Dec 15, 2005
48
IL
Hi
I want to write a web app. that does the following:

Client uploads a file to the server.
This file is placed in a queue of files from other clients waiting to be proccessed.
Each file needs to be proccessed individualy by a legacy single user dos application.
After proccessing the output is returned to the client and the next file in the queue is proccessed.

Is this feasable and if so can you suggest the basic outline of the web app.

Thanks
 
Check out faq855-5802 on how to launch an external application (you could launch a bat file that would output the results to a text file and then show that to the user).

As a side note, you've asked quite a few questions now yet you haven't acknowledged any of the answers given to you. If you don't know how to do this check out point #15 from the FAQ in my signature.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks for your reply.
I'd also like to know how to queue clients input and proccess the queue sequentualy ie. open 1 dos window for the web app and not for each client (session).
Do I need to write a web service to achieve this?
 
Yes, I'd say it's probably best to use a web service


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I'm actually not sure how creating a Web service would solve the issue if I understand the problem.

Is the issue that you don't want the console app getting launched several times simultaneously by multiple threads? If so, it's a synronization issue solved by making the block of code that runs the app thread-safe:

Code:
private static object lockObj = new object();

public string MyFunction( string clientData )
{
   //only one thread at a time can use this code
   lock( lockObj )
   {
       //this would launch the console app, wait for its...
       //results, then return them.
       //Make sure that you actually get results back...
       //before you free the lock. You don't want to...
       //simply launch the app and consider the job "done".
       return ProcessClientData( clientData );
   }
}
 
Thanks BoulderBum
That's what I was looking for.
If this function is running can other clients still upload their files or does this make the whole app. single thread?,
I would also need some way of controling in what order clients input gets processed.
What I'd thought of doing was putting the processing into a seperate vb exec that sits on the server waiting for input,
is that also a solution?.
 
That's where the web service part comes into it - create a service that will only allow one thread to run at one time (i.e. what BoulderBum suggested) and have your web app just call the service.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ca8msm that's what i'm asking if I make it a web service and call it from my web app will that not slow down the whole app as each time someone uploads a file and i then call a web service which will not be able to run cause a previous client has called the service, whereas if the processing was taken care of by a separate vb exec not connected to the web app then at least the upload part should run faster and I would have more control over the order the files where processed in.
 
A web service isn't connected to your web application just the same as the executable wouldn't be connected to it so there would be no difference in speed.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top