Data and close events firing for different connections

11 views
Skip to first unread message

rbax...@gmail.com

unread,
Jun 25, 2014, 8:26:33 PM6/25/14
to soc...@googlegroups.com
I am noticing something that I don't think is right, but I could be completely wrong and am probably doing something wrong.  Let me describe my scenario.

I have a Node.js server that is using a multiplexer to establish multiple channels with a sockjs service.  The browser uses the sockjs client to send and receive data to the server on the channels I have established.  I pretty much followed the Node.js multipliexer example from the Node.js source.  Whenever a new connection is established with the server, a close and data event listener is added to the connection.  

If I open my client side code in a single browser tab everything works fine.  However when I start having multiple connections simultaneously I am noticing something that does not seem right.  If I have 2 connections established because my client is opened in 2 browser tabs and one client sends data, I am noticing that BOTH data even listeners are being called with the data send from the one client.  Is this expected?  In my mind I would expect data send from client connection would only cause the data event for that connection to fire, not for all connections.

Any help is appreciated.

-Ryan
Reply all
Reply to author
Forward
0 new messages