As you noticed the example code you mention is not scaleable. It's fine when you know how many connections you're going to have, but if you don't it's better to spawn a process for each connection.
Have a look at the "DateServerUsingReentrantRun.vi" in the NI example finder. This spawns a server process for each client connecting to the server. I didn't really get what you're trying to do, but you can do something similar on the client side if required.