Added TODO-new-feature: Retry to connect to the server for maximum 5 times.
Added TODO: Combining the two connection management methods with the two data communication methods violates the Single Responsibility Principle.