Add a configuration parameter to set the read timeout in sockets before
reading data from them.
added connectTimeout as well

Together with the commit by @flozano this addresses issues #120 and #42