implement socket connect timeout.