LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP handle numbers

I have a cvi 5.5 server application where I have a client open a TCP pipe, do some stuff, and then close the pipe. I have been watching the handle numbers on the server. They seem to increment. I think that I am closing them correctly? Should the handle numbers be re-used, or is it normal that the handle numbers keep going up.
0 Kudos
Message 1 of 3
(2,658 Views)
Hello

I checked this out with the CVI examples for the tcp server and client, and you're right. It does increment the handle by one on the server side. So I think you are handling your resources fine, this is just the way the handle generation was implemented by the developers. Plus i would think that if you try to use the same port with closing the previous one, your sever would be aware that you never closed one of the connections. So that would be a better way to check for open connections.

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(2,658 Views)
I wish we had a more definative answer on this.

>>Plus i would think that if you try to use the same >>port with closing the previous one, your sever would >>be aware that you never closed one of the connections

I think that you are wrong on this one. I open the same port numerous times, each time from a different client, without an issue. I think that the actual ports that are opening are "ephemeral ports" which means that they are not really using the same port number, although I give it the same port number when I try to open.

I am worried about getting to 256 or 512 or however many ports is the maximum on WinNT. What happens? Do I need to reboot the PC,and if so, when I get to what port?
0 Kudos
Message 3 of 3
(2,658 Views)