title: sharing class object to another socket only shares the object and results in function not found
body: <p>So I have my own class in node.js , called - <code>test.js</code> in which there's a function called <code>bla()</code></p>
  <p>In my node1, I do the following.</p>
  <pre class="lang-js prettyprint-override"><code>const t = new test();
  io.emit('event', t);
  </code></pre>
  <p>and on my node2,</p>
  <pre class="lang-js prettyprint-override"><code>socket.on('event', (t) =&gt; {
    console.log(t); // this prints the correct output which means sockets work fine.
    const aha = t.bla(); // this results in a function not found.
  })
  </code></pre>
  <p>Looks like an object is getting shared, but not the actual instance . How do I fix this?</p>