Bug 777939: Add missing onStopListening for the REPL socket listener. r=vingtetun
authorMarshall Culpepper <marshall@mozilla.com>
Fri, 27 Jul 2012 11:19:56 -0500
changeset 100736 2ed080988987289b93f69403406d6e6207421b12
parent 100735 436fce553cd0de23ee330e4a7449980e6c4cf9e0
child 100737 f5d191758459da714367f0b8ac45430e614425f1
push id23193
push userryanvm@gmail.com
push dateSat, 28 Jul 2012 21:54:39 +0000
treeherdermozilla-central@29bff59d3bbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs777939
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 777939: Add missing onStopListening for the REPL socket listener. r=vingtetun
b2g/chrome/content/shell.js
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -395,16 +395,21 @@ Services.obs.addObserver(function onSyst
   let listener = {
     onSocketAccepted: function repl_acceptConnection(serverSocket, clientSocket) {
       dump('Accepted connection on ' + clientSocket.host + '\n');
       let input = clientSocket.openInputStream(Ci.nsITransport.OPEN_BLOCKING, 0, 0)
                               .QueryInterface(Ci.nsIAsyncInputStream);
       output = clientSocket.openOutputStream(Ci.nsITransport.OPEN_BLOCKING, 0, 0);
       output.write(prompt, prompt.length);
       input.asyncWait(reader, 0, 0, Services.tm.mainThread);
+    },
+    onStopListening: function repl_onStopListening() {
+      if (output) {
+        output.close();
+      }
     }
   }
   let serverPort = Services.prefs.getIntPref('b2g.remote-js.port');
   let serverSocket = Cc['@mozilla.org/network/server-socket;1']
                        .createInstance(Ci.nsIServerSocket);
   serverSocket.init(serverPort, true, -1);
   dump('Opened socket on ' + serverSocket.port + '\n');
   serverSocket.asyncListen(listener);