The time-out argument does not affect the actual time-out when instantiating the class. Suggestion: swapping lines 225 and 226 to configure the timeout before connecting the socket.