add timeout for socket connect to fix certain deadlock