title: Receiving Socket.IO message 2 times
body: <p>On a button click, I emit a message with socket.io:</p>
  
  <pre><code>$("#view-button").click(function () {
      console.log("button clicked");
      var textInfo = {
          msg: $("#message-field").val(),
          date: $("#date-field").val()
      }  
      socket.emit("text request", textInfo);
  });
  </code></pre>
  
  <p>In my index.js file, it receives it:</p>
  
  <pre><code>socket.on("text request", function(textInfo) {
      var textData;
      if (date &gt;= 6) {
          textData = "beginning";
      else {
          textData = "end";
      }
      socket.emit("text", textData);
  }
  </code></pre>
  
  <p>Then I receive the "text" socket message:</p>
  
  <pre><code>socket.on("text", function(textData) {
      console.log(textData);
      console.log("text data received");
  });
  </code></pre>
  
  <p>However, I am receiving the "text" socket message twice. I know this as "text data received" is being printed to the console twice. I checked the functions where the request is being emitted and the function where the text request is received and each of them only trigger once. How come I am seeing 2 "text data received" messages in the console but only one "text" socket message is being emitted?</p>