This is what i want to do:
+--------+ +--------+
| | | |
| Server |---+ +---| Client |
| | | | | |
+--------+ | | +--------+
| |
+--------+ | +--------+ | +--------+
| | | | | | | |
| Server |---+---+ Proxy +-----+---+ Client |
| | | | | | | |
+--------+ | +--------+ | +--------+
| |
+--------+ | | +--------+
| | | | | |
| Server |---+ +---| Client |
| | | |
+--------+ +--------+
The servers will connect to the proxy server, then clients will connect the proxy server and request to get redirected to one of the connected servers. e.g. Client1 wants to get redirected to Server3. My problem is, is that once a client is connected, i want to rebound it to another Server. You cannot rebound a socket once it is bound. Is there anyway around this?
Given the assumptions of the socket API, you are correct, a connection remains bound until it is closed.
Your two options are