firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Send the port on which the server was opened back to the parent process

Open akongara-goog opened this issue 2 years ago • 1 comments

Description

Send the port on which the server was opened back to the parent process, if this process was opened with an (node) IPC channel. If no such channel exists, nothing is changed.

Code sample

      childProcess.on("message", (port: Serializable) => {
        if (typeof port === "number") {
          // port is the port number of the child process.
        } else {
          // handle error
        }
      });

akongara-goog avatar Nov 07 '22 18:11 akongara-goog