Implement socket timeout