allow setting socket timeout
patch from Herald van der Breggen