Add optional support for socket timeouts