Hi evangel55,
In general, you should create one "listener" thread (on a single port) that accepts connections and then spawns off slave threads to handle each connection. The first data passed across the connection should identify which PC is connecting. In your case, this could be in the form of one "identification" byte that corresponds to PCs 1-5. In your code, you can switch on this byte and handle the rest of the messages accordingly.
While it is possible to setup 5 separate listener threads, each on a different port, this approach will require more overhead and it is really unnecessary.
For an in depth discussion on creating network applications in CVI, please refer to the following article on our website:
Building Networked Applications with the LabWindows/CVI TCP Support LibraryAlso, as a starting point, you can refer to the following multi-threaded network example:
<CVI>\samples\tcp\MultiThreading.cwsThis example actively refuses more than one connection (as seen on line 117 of
MultiThreadingServer.c), so this is where you would instead spawn a new slave thread.
Regards,