set timeout for the socket