LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems by using multiple datasocket clients with just one Datasocket Callback?

Hello forum members,

 

I have a litte question regarding the use of the datasocket functionality.

I want to read out the html code of several urls.

Therfore I create an array of all the url's, which I would like to read out.

For every url I do the dsopen() function, in a for loop.

There I capture the handels of every datasocket which I had opened before.

 

In the callback function, which is specified in the dsopen function call, I would like to handel all the different datasocket calls.

Therfore I compare the handel which calls the callback function with my array of datasocket handels.

 

 

Now I found a little problem, that when I am open more than 3 datasockets I recieve an error message. "ERROR attempting ..."

And then the program stops.

 

Might it be the wrong way to use only one callback function for serveral handels, do I need to have a single callback for every single handle ?

Does anyone of you have some experience and could give me an hint?

 

Thanks in advance

Michael

0 Kudos
Message 1 of 2
(2,883 Views)
No, it is not incorrect to use one callback function for multiple datasocket handles. The error you are getting is probably related to establishing a connection to the website or downloading data from it. I am attaching my sample code that reads from 5 different web pages using a single callback function.
0 Kudos
Message 2 of 2
(2,873 Views)