-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple listeners to be bound to a server #12
Comments
Meant to leave this on Socket.IO-node |
Are you saying you have two HTTP servers, or you have two widgets that need realtime connectivity in the same page? If the answer is the latter, you have to build a small protocol on top of a single io.Listener to channel the messages. At LearnBoost, we built a simple channel-subscription model tied to server side and client side event listeners, so that we can have several independent flows of communication, but with only 1 transport initialization per client. |
I'm working on a remote JavaScript debugger - on one page, you've got a console. On the other page the debugger is running. Whenever a debugger connects it opens a new channel. Consoles connect to a debugger channel to receive messages. Debuggers send messages to all connected consoles. I could use conditional logic inside the connection/message event listeners, it would seem more DRY to create multiple listeners and have the correct one fire by inspecting the "resource".
|
I've have two distinct types of connections coming at my server - it would seem the easiest way to separate them would be to bind create two io.listeners and change the resource of each connection type - however in the current implementation in
Listener.init
will just grab the last Listener bound to the server!p.s Fantastic piece of software!
The text was updated successfully, but these errors were encountered: