Bug 917479 - Starting a simulator changes host and port settings. r=ochameau

This commit is contained in:
Paul Rouget 2013-10-01 17:38:51 -04:00
parent 156c9c3570
commit c6d3da3393

View File

@ -120,6 +120,7 @@ let UI = {
},
startSimulator: function(version) {
this._portBeforeSimulatorStarted = this.connection.port;
let port = ConnectionManager.getFreeTCPPort();
let simulator = Simulator.getByVersion(version);
if (!simulator) {
@ -152,6 +153,12 @@ let UI = {
_onSimulatorConnected: function() {
this.connection.log("Connected to simulator.");
this.connection.keepConnecting = false;
// This doesn't change the current (successful) connection,
// but makes sure that when the simulator is disconnected, the
// connection doesn't end up with a random port number (from
// getFreeTCPPort).
this.connection.port = this._portBeforeSimulatorStarted;
},
_onSimulatorDisconnected: function() {