-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: only use server listen to detect port #13
Conversation
use npm scripts instead of Makefile
@xudafeng 原来的实现太复杂了,只需要 server listen 即可,不需要客户端 connect |
loop(port); | ||
server.on('error', err => { | ||
debug('listen %s error: %s', port, err); | ||
port = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
失败一次之后马上监听随机端口,确保操作系统分配成功。
return promise; | ||
} | ||
}; | ||
server.listen({ port }, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 不支持这个解构
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
喔,看错,不是函数签名
@fengmk2 👍 |
@xudafeng 发一个 minor 版本 |
done |
use npm scripts instead of Makefile