12-19-2009 03:46 PM
12-19-2009 04:59 PM
One idea is that you have the server listen on that 1 port. If the server gets a request for a connection, then the server can open up another port that is unique for that one connection. It sends the new port number back to the requester on the original port values. The requester now can request a connection on that new port number and close off the connection on the original port number and free it up for future requesters.
Basically the single port number becomes a means for the clients to connect to the server and the server will dynamically create a new port number that the client can establish its real connection with.
12-21-2009 11:54 PM
I am hoping that there is something similar to the java api where there is some way I can start a new threads to handle multiple connections on the same port. I would assume that if java has it LabVIEW would have something similar. Unfortunately I am not sure how to go about finding out how to do such a thing in LabVIEW.
The way that I assume the TCPListen.vi works is that there is some mechanism polling the specified port and ip address waiting for a request for a connection. Once a request is received the VI creates a connection ID so that the other subvi's can perform operations on the specific connection. It also looks as though the TCPListen.vi continues to listen for new connections, because the clients indicate a connection when more then one of them are run trying to connect to the same port and IP.
So my question is either, how to start a parallel process to handle the new connections, or where can I find the new connection ID (because the indicator only shows the connection id of the first client to connect). Basically I am having trouble distinguishing between the multiple connections on the same port.I would like to keep all of the clients sending data through the same port if possible.Each client identifies itself in its data message so keeping the data organized is not a problem.
I also looked at the data socket examples, mainly because the Java examples I was looking at used "Sockets". I ran into similar troubles finding a way to create distinguishable connections using DS's as well. Anyways, any help is appreciated. Thanks.
12-22-2009 03:56 AM
Each connection has it's own unique connection ID - so what you need to do is to create a connection handler for each connection. This can be done dynamically to allow for any number of connections. There is an example of such an architecture here:
http://zone.ni.com/devzone/cda/tut/p/id/3982
12-22-2009 08:55 AM
12-22-2009 04:12 PM
12-22-2009 04:19 PM
01-10-2010 03:47 PM
I have been trying to build a vi like the vi shown at the url that was posted above...
http://zone.ni.com/devzone/cda/tut/p/id/3982
I cannot find the queue vi's they look like the background might be white indicating that they are possibly some custom vi's if so is there a place to download the library. I have gone through the queue vi's that are available in the pallet but the ones that I found were a little different. Is the example available for download anywhere? Any help is appreciated thanks.
01-10-2010 10:35 PM
Those examples were created with a much earlier version of LV. Possibly 6.1 based on the write-up. And a comment was added that was dated 2001. The appearance of the queue functions have changed since then.
All the functions are there, they are just yellow now, and the other colors (blacks, purples) have been removed.
In the upper diagram, in order: obtain queue, enqueue element.
In the lower diagram, in order: obtain queue, queue status, deqeeue element