Do you have to use TCP?
It would seem using UDP and doing a broadcast would be more efficient.
In any case, I believe you have to disconnect your socket from the current machine before you can connect it to the next machine.
If you need to keep multiple connections open, then you need multiple sockets on your client, one for each server, to maintain the connection to a given machine.
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.