I have a server and clients A and B. Clients A & B are identical. As of now, client A connects to the server over a persistent long living TCP connection. Currently if I want to do maintenance restart in client A, I have to shut it down and make a new connection from client B and then do the maintenance in client A. Finally once client A is ready, I disconnect client B and connect the server from client A. If I want active-active setup without any disconnection to the server, how to achieve this?

Please note that this is not a server which can accept multiple concurrent connections. This is a custom server written for a special purpose. It can accept a single connection at a time and I am trying to have multiple clients which can send data to the server simultaneously without dropping the connection with the server.

I am thinking of something like a 'jumpbox' in the middle where 'jumpbox' connects to the server over a long living TCP connection. Clients A & B should be able to connect to 'jumpbox' simultaneously and both should be able to send data to the server via 'jumpbox'. In the whole time, the connection between the server and 'jumpbox' shouldn't be disconnected. Is this possible?

Edit: lets say I am running nc -l 35000 in the Server. I should be able to connect to the server from both Client A & Client B such that nc 35000. If I type something either on Client A or Client B, it should be sent to the server

  • It is not clear for me how you imagine the "jumbox" to work. While one could write a program which accepts multiple connections and forwards the traffic within a single connection to a single server it is not clear what should happen when multiple clients send data. Should the traffic be somehow mixed and the combined data be send to the server? And how exactly should this "somehow" be? And even harder: which client should get the responses from the server? – Steffen Ullrich Aug 11 '20 at 5:11
  • @SteffenUllrich let's just take the netcat example I mentioned in the question. Consider Client A is connected to Server. Now I want to connect Client B to the server and disconnect Client A while doing that. At the same time, the TCP connection from the server should not be dropped. Instead it should now be connected to Server B. – Poomalairaj Aug 11 '20 at 7:26
  • I see, when B connects to the jumpbox it should automatically disconnect A from this box but maintain the connection to the server. This is likely doable with the programming but I'm not aware of any existing tool which allows this. Apart from that the application protocol might require some initial handshake (like client authentication) which would mean that some simple traffic forwarding would not be sufficient and the problem even harder to solve. – Steffen Ullrich Aug 11 '20 at 9:12

All of this is based on the assumption that the server is running a flavour of Linux. I would use an intermediary box to establish connections to the server so it "holds" the connections. Client A or B would SSH into the middle box or "jumpbox" and connect to a Screen console, which has the open sessions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.