title: Why does the data event only stop the NodeJS run time from exiting?
body: <p>Take the following code in nodejs-:</p>
  
  <pre><code>console.log("Hello world");
  process.stdin.on('connect', function() {
  
      });
  </code></pre>
  
  <p>This prints Hello World and then Node exits. But when I replace the connect event with 'data' event, the Node runtime does not exit.</p>
  
  <p>Why is that ? What is so special about the EventEmitter's data event ? Does it open a socket connection ? So in the on() method is there code like the following -:</p>
  
  <pre><code>function on(event, callback) {
  if(event === 'data') {
       //open socket
       //do work
      }
  else {
     //do non-socket work
     }
  }
  </code></pre>
  
  <p>Is there a clear answer to why adding a listener to the data event "magically" open a socket.</p>