A
A
Andrew2019-10-10 10:46:05
Programming
Andrew, 2019-10-10 10:46:05

How to reconnect client to server?

There is a client application that can lose connection with the server for various reasons (network loss, server crash, etc.)
Now I incrementally change the reconnect attempt time up to 5 minutes.
That is, the first attempt after one second, after two seconds the second attempt, after three seconds the third, etc.
I would like to know what is the most efficient way to automate preconnection?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Forevka69, 2019-10-10
@Forevka69

find out if there is a network connection using OS tools, if there is, try to connect. You can try at least every second, this should not be a special load for the PC

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question