Allow to configure timeout

allow to the client to configure the socket timeout.
default timeout is still 0.