I am planning to create a sofware load balancer that will sit in front of many socket servers in linux. The clients will connect to the load balancer . The load balancer will maintain a table of alternative ips and their ports. It will connect the client to the best available ip and port and disconnect itself from the client.Thus it will go out of the scene(will no longer be connected to the client).In this condition only connected devices will be the client and the new socket server but NOT the load balancer.
Example : Cleint ip 10.1.2.3 port 1234
load balancer Ip 10.1.2.4 port 1235
list of socket servers in Load Balancer:
A Ip 10.1.2.4 port 1236
B Ip 10.1.2.4 port 1237
C Ip 10.1.2.5 port 1238
Now
for the 1st request to the load balancer from client, the load balancer will establish a connection between the client & server A and disconnect itself from client.
for the 2nd request to the load balancer from client, the load balancer will establish a connection between the client & server B and disconnect itself from client.
for the 3rd request to the load balancer from client, the load balancer will establish a connection between the client & server C and disconnect itself from client.
Any Help on implementing this in Java is greatly appreciated.