Added timeouts for read operations on socket and support in case the connection to the server goes down