All the latest client libraries automatically reconnect as soon as the connectivity is restored. In a completely transparent way for the application that does not have to do anything.
Please could you specify the client library type (and the version) in use?

Regards,
Giuseppe