LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is the TCP connection ID always unique?

I've inherited a suite of applications that communicate via TCP/IP.  In the course of fixing a bug I used a type cast to convert the TCP Connection ID to a U32 so I could watch the value.  The apps open a connection, perform a transaction, and close the connection each time they communicate.  I noticed that the ID is always unique.  Values are not re-used when a connection is closed.  That makes me wonder what the Connection ID really is.  The change from one session to the next is consistent, but too large to lead me to believe the Connection ID is really a pointer (i.e. memory address).  If it is some type of pointer though, the uniqueness would lead me to believe that there is a memory leak here.
 
Can anyone shed more light on interpreting the Connection ID?
0 Kudos
Message 1 of 2
(5,330 Views)
I believe that most LabVIEW IDs/references (examples: config file ref, TCP Conn ID) are pointers to internal structures.

If you poke around in some of the Utility folder VIs, you'll find functions that will "query" the reference/ID and return a raw type (memory location or value). One example would be vi.lib\Utility\tcp.llb\UDP Get Raw Net Object.vi will take a LabVIEW UDP ConnRef and return the raw OS socket. I used this technique to retrieve and then customize the UDP socket's buffer size at the OS level. See  http://forums.ni.com/ni/board/message?board.id=170&message.id=232025#M232025

Note that any time you manipulate the underlying OS this way, you might render your LabVIEW reference unstable.

(p.s. there is also a TCP Get Raw Net Object vi Smiley Wink The socket numbers should increment by one..)

Message Edited by Phillip Brooks on 04-30-2007 08:05 AM

0 Kudos
Message 2 of 2
(5,303 Views)