added configurable socket timeout