Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETIMEDOUT on Windows 10 #4

Open
MystK opened this issue Jun 13, 2016 · 3 comments
Open

ETIMEDOUT on Windows 10 #4

MystK opened this issue Jun 13, 2016 · 3 comments

Comments

@MystK
Copy link

MystK commented Jun 13, 2016

Doesn't seem to work with Windows. Am I doing something wrong?

const findOpenPort = async port => {
  try {
    const available = await findPort.isAvailable(port)
  } catch (error) {
    console.log(error)
  }
  if (!available) return await findOpenPort(port + 1)
  return port
}
npm start

> [email protected] start c:\Development\
> node entry

{ [Error: ETIMEDOUT] code: 'ETIMEDOUT' }

Also, this code works fine on OSX running latest El Capitan.

@MystK
Copy link
Author

MystK commented Jun 13, 2016

Issue solved. The timeout of 400ms is too quick for Windows I guess. May I make a PR to increase the timeout to 15 seconds?

    socket.setTimeout(400, function onTimeout() {
      socket.destroy();
      var error = new Error('ETIMEDOUT');
      error.code = 'ETIMEDOUT';
      reject(error);
    });

@jkrems
Copy link
Member

jkrems commented Jul 27, 2016

We'd definitely accept a PR like that - although 15 seconds sounds a bit high. Maybe 1500ms? Or is that not enough on windows? If it needs more than that, maybe even a platform switch would be okay (win32 ? ultraLongTimeout : normalTimeout).

@jkrems
Copy link
Member

jkrems commented Jul 27, 2016

Thanks for tracking this down and sorry for the late response, btw. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants