TIMOB-17181 LiveView: build fails when installing on a different device/... #80
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.
We are initially starting the liveview server in the end or error events of the http.get call. However, seems that the http.get() call does not always end up in either of those events. The more consistent event we can rely on is the 'close' event after the http.get() call.
So, we are starting the liveview server after the existing servers are requested to kill. So, we can handle the timing issues on Windows and at the same time, it is more consistent that we will definitely end up starting up the liveview server each time.
Also, when there is a request to kill the existing running server, we should trigger the 'end' event before the socket/server are closed. This will help the clients to continuously keep on attempting to connect to the liveview servers, instead of just failing with error saying that server is unreachable.