LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

inettelnetclose handle release

Hi,

 

  I currently make use of the Inet library to communicate with one of our products.  My problem lies with the fact that I have to open and close 2 Telnet sessions at an interval of 5 seconds.  From what I can see the InetTeleOpen function will open the Telnet session successfully and return a positive number for a handle.  My question lies with the InetTelnetCLose function.  Does this function release the handle once it has closed the Telnet session.  From what I can see the handle is never released and causes my application to run out of available handles.  The InetTelnetOpen function allows a maximum of 1024 Telnet sessions simultaneously.  If the InetTelnetClose function does not release the handles, After approximately 4 hours I run out of available handles and my code crashes.

I am currently using LabWindows\CVI 2012 on a Windows 7 PC.  If you can kindly let me know how I can release the handle after a InetTelnetClose that would be great.

 

Alain

0 Kudos
Message 1 of 8
(5,243 Views)

Hi apaquett_98, 

 

How do you know that it only allows 1024 sessions? Are you getting an error? If so it would be helpful to know what kind of error you are seeing.

 

Why it is required that you open handles at that frequency?

 

It might be helpful if you could attach pseudo code for a typical execution in the program. 

Rachel M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(5,214 Views)

Hi Rachel,

 

  To answer your first question, I have tried opening and closing the Telnet session in a loop to see what the limits would be and I found it to be 1024.  Yes it does return an error but at this time I do not remember what the exact error was.  I can repeat the experiment and let you now what the error was.  As for the second question regarding the frequency of Opening/Closing the Telnet session.  This is done to communicate with a Telecommunication node running in a thermal environment for an extended period of time.  I am required to login to this node at regular intervals therefore I Open a Telnet session, retrieve information from the node then close the Telnet session.  I did this way rather then keeping the Telnet session open and risking the session would timeout.  My real question is why don't the assigned handles get released when they are no longer in use?  I would have thought that closing the Telnet session would have relesed the handle but unfortunately it doesn't.

 

Alain

0 Kudos
Message 3 of 8
(5,091 Views)

Hi Alain, 

 

Unfortunately, as I am not a developer, I can not speak to why the handles do not get released. If you are seeing a specific error, and would like to work on resolving that, I think it would be very helpful if you could post that specific error. If you could post a sample of code showing us an example of execution, I think that would also be helpful.

 

Thank you,

Rachel M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(5,069 Views)

Hi, I'm facing a similar problem. I'm working a testsystem with about 20 telnet clients. Since most of them close the connection itself after a quite short time, I have to close and open the connections quite frequently. After about two hours I'm geting a socket error (kInetSocketError  -4). Is there a possibility to solve the problem, or to find a workaround?     

 

Regards Andreas              

0 Kudos
Message 5 of 8
(2,819 Views)

Hi!

I'm just wondering did you try to build your program using the example that comes with CVI that is called telnet.cws

You can found it on the help tab, select search, and type telnet.

0 Kudos
Message 6 of 8
(2,807 Views)

Hi

Of course, I used this project and it worked well as it is. But if I change it to fit my needs, it shows me the same problem. I can not really reproduce the error. Some times it occures at the first call, some times after hundert calls. Indeed, it could be caused by any reason. So, at first I switched off all the energy saving stuff, and so on, without success.

Menwhile I built up a second system with the same hard- and software configuration and the problem didn't disapear.

 

But the general questeion is how to investigate a problem further, after the winsock error (-4). I mean is there a hint from the operating system? I did not found any entry in the windows event logs....

 

Regards

Andreas

 

Configuration:

CVI 2017, DELL PC/Win7/32Bit, and additional NIC

 

 

 

 

0 Kudos
Message 7 of 8
(2,538 Views)

Andreas,

 

It is likely that you're not closing all your references properly. If you restart your computer and leave the program running, how many times does this occur? If you restart it again and run the program, does this occur at the same time? This is under the assumption that restarting the computer will clear the references.

 

Bdog

 

 

0 Kudos
Message 8 of 8
(2,515 Views)