added option for specifying a TCP connection timeout