fix(debugging): Don't close inspector socket after 30 sec. timeout #907
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
The inspector listening socket is being closed 30 sec. after the last
activity on it (opening, disconnection, etc). It had to be closed in order
to have the hardcoded port number 18181 available for other apps after
finishing (or never starting) a debugging session. Without this timeout
the first app that opened the port would take it for as long as it's running
and would prevent any subsequent debugging attempts of another app on
the same iOS device; or even any {N} app on any iOS Simulator on the
same Mac machine.
What is the new behavior?
From now on, the default port becomes 18182 and if it is unavailable,
a random free port will be used. Its number will be output in the
application log. When starting a debug session, {N} CLI will monitor
the logs in order to receive the allocated port number for the current
session.
This will allow to connect the frontend at any moment after starting a
debug session, instead of failing after the 30 seconds have elapsed.
This PR has to be merged along with NativeScript/nativescript-cli#3540. Wait for it to be approved.