bcc_socket.js
function openSocket (sessionInfo, callback) {
      var socketUrl, socketInfo, socket_endpoint, new_socket;

      _log(sessionInfo);

      socketUrl = sessionInfo.endpoints.socket[0];
      socketInfo = url.parse(socketUrl);
      _log(socketInfo);

      socket_endpoint = socketUrl + me.setting.apiroot + '/feed/ws?sid=' + sessionInfo.sid;
      _log('Connecting to ' + socket_endpoint);

      new_socket = new ws(socket_endpoint);
      new_socket.on('open', function () {
        _log('socket open');
        callback(new_socket);
      });
    }
function openSocket (sessionInfo, callback) {
      var socketUrl, socketInfo, socket_endpoint, new_socket;

      _log(sessionInfo);

      socketUrl = sessionInfo.endpoints.socket[0];
      socketInfo = url.parse(socketUrl);
      _log(socketInfo);

      socket_endpoint = socketUrl + me.setting.apiroot + '/feed/ws?sid=' + sessionInfo.sid;
      _log('Connecting to ' + socket_endpoint);

      new_socket = new ws(socket_endpoint);
      new_socket.on('open', function () {
        _log('socket open');
        callback(new_socket);
      });
    }
function openSocket ( sessionInfo , callback ) { var socketUrl , socketInfo , socket_endpoint , new_socket ; _log ( sessionInfo ) ; socketUrl = sessionInfo . endpoints . socket [ 0 ] ; socketInfo = url . parse ( socketUrl ) ; _log ( socketInfo ) ; socket_endpoint = socketUrl + me . setting . apiroot + '/feed/ws?sid=' + sessionInfo . sid ; _log ( 'Connecting to ' + socket_endpoint ) ; new_socket = new ws ( socket_endpoint ) ; new_socket . on ( 'open' , function ( ) { _log ( 'socket open' ) ; callback ( new_socket ) ; } ) ; }
connect to first available socket endpoint
connect to first available socket endpoint