LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

INET_NumWebConnections

hello,

i am facing a problem with "INET_NumWebConnections". i can not manage to get a stable number of connection from it.

*******************************************************************************************************************
k = INET_NumWebConnections (webhandle);


if(k<=1){
CopyFile ("control.htm", "experiment.htm");

}
else
{
CopyFile ("monitor.htm", "experiment.htm"); }
*******************************************************************************************************************

as show above, i need to display the control.htm if k<=1 or else display monitor.htm. but since i can not get a stable number of connection, so it will sometime display control.htm even thought the number of connection (k)suppose to be >1.

so i am wondering is it the problem of my IP or is it the "INET_NumWebConnections" problem?

thanks alot
0 Kudos
Message 1 of 4
(2,656 Views)
Hello Kenshi,

I'm assuming you're using Internet Explorer and Client Pull updates.

Internet Explorer only supports Client Pull updates as documented in the following MSDN Knowledge Base. With the client pull mechanism, clients connect to the server, receive updates, and immediately disconnect from the server. In client pull, HTTP connections are never held open; rather, the client is told when to open a new connection, and what data to fetch when it does so. Therefore, the INET_NumWebConnections function may seem to return unstable results if you are using Internet Explorer since at any given time, you might not have the same amount of open connections as you have clients.

One option would be to create a log file with the INET_StartWebServer function. Then insert comments into this log file when a client logs on/off with the INET_AddToWebServerLog function. Then search through the log file to see how many different computers are connected to your site.

Hope that helps.
0 Kudos
Message 2 of 4
(2,642 Views)
hello wendy,

do i still face the same situation if i use Netscape with SERVERPUSH command?
0 Kudos
Message 3 of 4
(2,636 Views)
Hello Kenshi,

You shouldn't face the same issue since when clients connect with the server push technology, the connection is kept open. Therefore, the NumWebConnections function should return the correct number of connected clients.

Thanks.
0 Kudos
Message 4 of 4
(2,633 Views)