Shepard
Shepard

Reputation: 811

Moving socket ownership to another machine on the same LAN

I am thinking to a scenario where there is a front machine, behind a router, that accepts incoming connections with the purpose of doing load balancing.

After having established what is the right server for the job, it simply yield to it the socket so that the designed server can send data directly to the client.

Is that possible to "reparent" in some way an active socket connection, without further passing through the load balancing server, or the only way is to notify the client to open a new connection?

Upvotes: 1

Views: 44

Answers (1)

JJF
JJF

Reputation: 2777

Passing a socket to a process on another machine is not possible. Your load balancer is going to have to participate in the response using the original request socket.

Either that or you will have to develop a protocol between the client and load balancer where the load balance tells the client which server the client should redirect its request to.

Upvotes: 1

Related Questions