Add support for socket timeout (default to 5 sec)