05-19-2011 03:23 AM
Hi,
I am making a very simple communication tool that can be used in a web browser.
I am using the TCP Listen.vi to listen to incoming connections.
The problem that I am having is that I can not deal with multiple requests. as I miss some requests whilst I am dealing with the previous request. I have programmed a web server in Java and C before and I simply use threads.
A screenshot of my code is below, I tried to use a queue to combat this, but it still happens as the requests happen at a fast rate.
The requests look like:
GET index.html
GET image1.png
GET image3.png
And I never recieve a request for image2.png
Regards
Joe
05-19-2011 05:43 AM
Can anyone help?
To overcome this issue, I have to have 4 producer loops (i.e. 1 for each request based on my basic html page)
and currently because I have only 1 consumer loop it can only deal with 1 request at a time, making things slow.
05-23-2011 09:58 AM
Hello Joe,
I can see that you are using variables to pass the queue reference, this should be avoided and you should wire the references through appropriately. Apart from this I am not sure I can suggest anything else without understanding how you are passing/receiving information in your producer loops. In general you will have problems with a single read and multiple writes unless you manage your resources correctly and carefully.
If possible, please post the rest of your code (or preferebly your complete VI) along with a brief summary of what your application is to achieve and I will help as best I can.
Kind Regards,
Michael S.
Applications Engineer
NI UK & Ireland
05-25-2011 10:54 AM
Hello Joe,
How are you getting on? Did removing the local variables and replacing them with wires help?
Let us know if we can help further.
Kind Regards,
Michael S.
Applications Engineer
NI UK & Ireland