Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Reconnect Channels on Socket Reset #2
commented on an outdated diff
Dec 22, 2012
|@channels[name] ?= new Channel name, @ssocket|
|+ # if we just got a new socket, reconnect the channels|
|+ connect: (socket) ->|
|+ reconnectChannels = =>|
|+ for name, channel of @channels|
|+ @channels[name] = new Channel name, socket|
|+ @channels[name].listeners = channel.listeners|
|+ @channels[name].events = channel.events|
|+ setTimeout reconnectChannels, 100|