Yes, in theory, but the main problem would be that your applications would be much, much slower (for example, from 100 to 1000x), and this is what causes most people to perform full replication.
Instead, you need to create a data stream from important pieces of information, for example. all incoming or outgoing messages (or both) and send them to a second computer and rebuild the state from existing data.
BTW: When you lose the TCP connection to the server, they should be closed and reconnected. They do not fail transparently. UDP avoids this problem without having connections, but it is much more difficult to work with reliability. One way is to have a simple proxy / load balancing server located between the client and the server. Because it is simple, it is less likely to fail, and it hides the server connection. However, if you have a data center malfunction, it will also disappear.
source share