title: How does socket.io get arguments from the client?
body: <p>I have the following code on the server side:</p>
  
  <pre><code>var io = socket(server);
  
  io.on('connection', function(socket){
      console.log('made socket connection with ID:', socket.id);
  });
  </code></pre>
  
  <p>Here is what I understand. </p>
  
  <p>We make a socket on the server side and pass that (instance?) to io. Then, we say io.on('connection') which is saying listen to the connection event. We also make a callback function to which we are passing socket. </p>
  
  <p>I don't understand the callback function(socket) part. Where are we passing it socket? on the client side I have this</p>
  
  <pre><code>var socket = io.connect('http://localhost:4000');
  </code></pre>
  
  <p>I get that a connection will be made and it will start listening but how and where are we calling the function form the client side?</p>