Added timeout to the connection

Added timeout to all clients.