package/EmberSockets.js
function _listen() {

            var controllers     = $ember.get(this, 'controllers'),
                getController   = Ember.run.bind(this, this._getController),
                events          = [],
                module          = this,
                respond         = function respond() {
                    var eventData = Array.prototype.slice.call(arguments);
                    module._update.call(module, this, eventData);
                };

            controllers.forEach(function controllerIteration(controllerName) {

                // Fetch the controller if it's valid.
                var controller  = getController(controllerName),
                    eventNames  = controller[this.NAMESPACE];

                if (controller) {

                    // Invoke the `connect` method if it has been defined on this controller.
                    if (typeof controller[this.NAMESPACE] === 'object' && typeof controller[this.NAMESPACE].connect === 'function') {
                        controller[this.NAMESPACE].connect.apply(controller);
                    }

                    // Iterate over each event defined in the controller's `sockets` hash, so that we can
                    // keep an eye open for them.
                    for (var eventName in eventNames) {

                        if (eventNames.hasOwnProperty(eventName)) {

                            if (events.indexOf(eventName) !== -1) {
                                // Don't observe this event if we're already observing it.
                                continue;
                            }

                            // Push the event so we don't listen for it twice.
                            events.push(eventName);

                            // Check to ensure the event was not previously registered due to a reconnect
                            if (!(eventName in $ember.get(module, 'socket')._callbacks)) {

                                // ...And finally we can register the event to listen for it.
                                $ember.get(module, 'socket').on(eventName, respond.bind(eventName));

                            }

                        }

                    }

                }

            }, this);

        }
function _listen() {

            var controllers     = $ember.get(this, 'controllers'),
                getController   = Ember.run.bind(this, this._getController),
                events          = [],
                module          = this,
                respond         = function respond() {
                    var eventData = Array.prototype.slice.call(arguments);
                    module._update.call(module, this, eventData);
                };

            controllers.forEach(function controllerIteration(controllerName) {

                // Fetch the controller if it's valid.
                var controller  = getController(controllerName),
                    eventNames  = controller[this.NAMESPACE];

                if (controller) {

                    // Invoke the `connect` method if it has been defined on this controller.
                    if (typeof controller[this.NAMESPACE] === 'object' && typeof controller[this.NAMESPACE].connect === 'function') {
                        controller[this.NAMESPACE].connect.apply(controller);
                    }

                    // Iterate over each event defined in the controller's `sockets` hash, so that we can
                    // keep an eye open for them.
                    for (var eventName in eventNames) {

                        if (eventNames.hasOwnProperty(eventName)) {

                            if (events.indexOf(eventName) !== -1) {
                                // Don't observe this event if we're already observing it.
                                continue;
                            }

                            // Push the event so we don't listen for it twice.
                            events.push(eventName);

                            // Check to ensure the event was not previously registered due to a reconnect
                            if (!(eventName in $ember.get(module, 'socket')._callbacks)) {

                                // ...And finally we can register the event to listen for it.
                                $ember.get(module, 'socket').on(eventName, respond.bind(eventName));

                            }

                        }

                    }

                }

            }, this);

        }
function _listen ( ) { var controllers = $ember . get ( this , 'controllers' ) , getController = Ember . run . bind ( this , this . _getController ) , events = [ ] , module = this , respond = function respond ( ) { var eventData = Array . prototype . slice . call ( arguments ) ; module . _update . call ( module , this , eventData ) ; } ; controllers . forEach ( function controllerIteration ( controllerName ) { // Fetch the controller if it's valid. var controller = getController ( controllerName ) , eventNames = controller [ this . NAMESPACE ] ; if ( controller ) { // Invoke the `connect` method if it has been defined on this controller. if ( typeof controller [ this . NAMESPACE ] === 'object' && typeof controller [ this . NAMESPACE ] . connect === 'function' ) { controller [ this . NAMESPACE ] . connect . apply ( controller ) ; } // Iterate over each event defined in the controller's `sockets` hash, so that we can // keep an eye open for them. for ( var eventName in eventNames ) { if ( eventNames . hasOwnProperty ( eventName ) ) { if ( events . indexOf ( eventName ) !== - 1 ) { // Don't observe this event if we're already observing it. continue ; } // Push the event so we don't listen for it twice. events . push ( eventName ) ; // Check to ensure the event was not previously registered due to a reconnect if ( ! ( eventName in $ember . get ( module , 'socket' ) . _callbacks ) ) { // ...And finally we can register the event to listen for it. $ember . get ( module , 'socket' ) . on ( eventName , respond . bind ( eventName ) ) ; } } } } } , this ) ; }
Responsible for listening to events from Socket.io, and updating controller properties that
subscribe to those events.

@method _listen
@return {void}
@private
Responsible for listening to events from Socket . io and updating controller properties that subscribe to those events .