LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit client connections to TCP Listen?

Hi all,
 
Is it possible to limit the number of client connections to a server TCP Listen?
 
We are trying to simulate the interface of a TCP server device that only allows a single client connection and then mantains a dialog with that client.
 
All further attempts of other client attempting to connect to the TCP Listen service should fail.
 
Regards
 
Phill
0 Kudos
Message 1 of 3
(3,349 Views)

Hi Phill,

i think there is no ready version from LabView, but you can program this functionallity by yourself. Count the connections you have and dependig on it you can save this connection to work on it later or you send the string back "sorry number of allowed users ..." or something like that and the server close this connection.

Another solution could be to destroy the listener after the number of allowed connections is reached, but i think this is not the best.

Mike

0 Kudos
Message 2 of 3
(3,348 Views)
The easiest way (although not extensible to more than one connection) is to end the listening loop once there is a connection and to transfer the connection reference into the comm loop. If the client disconnects, you go back to the listening loop.

___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(3,327 Views)