LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

web server threads

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 

 

undefined 

 

Regards

 

Joe 

0 Kudos
Message 1 of 4
(2,376 Views)

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.

 

0 Kudos
Message 2 of 4
(2,358 Views)

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

0 Kudos
Message 3 of 4
(2,339 Views)

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

0 Kudos
Message 4 of 4
(2,329 Views)