my installation is not working and io.on('connection') callback in server.js is never being called because (as far as i can tell) drupal module javascript is

io.on('connection', function(socket) {
    clientManager.addSocket(socket);
  })
  .on('error', function(exception) {
    console.log('Socket error [' + exception + ']');
  });

my node.config.js file

/**
* This configuration file was built using the 'Node.js server configuration builder'.
* For a more fully commented example see the file nodejs.config.js.example in the root of this module
*/
backendSettings = {
  "scheme":"http",
  "host":"localhost",
  "port":7001,
  "key":"/path/to/key/file",
  "cert":"/path/to/cert/file",
  "resource":"/socket.io",
  "publishUrl":"publish",
  "serviceKey":"",
  "backend":{
  "port":80,
  "host":"async1.vs",
  "messagePath":"/nodejs/message"},
  "clientsCanWriteToChannels":false,
  "clientsCanWriteToClients":false,
  "extensions":"",
  "debug":true,
  "transports":["websocket","polling"],
  "jsMinification":true,
  "jsEtag":true,
  "logLevel":1};

i've added some trace messages in. the problem is no socketid's because not being saved in

io.on('connection')
[2017/05/04 19:18:38] Body
{ broadcast: true,
  data: 
   { subject: 'A user <em class="placeholder">logged in</em>.',
     body: 'The user <a href="/user/2">user2</a> <em class="placeholder">logged in</em>.' },
  channel: 'nodejs_notify',
  clientSocketId: '' }
broadcastMessage:entry
broadcastMessage:exit
[2017/05/04 19:18:38] message broadcast to 0 users

Comments

laurencefass created an issue. See original summary.

Syntapse’s picture

this is the best info i have though i logged a more vague issue based on the same problem.

preferred that we move discussion to here and i can close previous issue.

is this module still being actively maintained?

Syntapse’s picture

drupal nodejs integration php module: nodejs.js line 88 is checking io object. where is io defined and why is it silently returning a false. isnt 'undefined' an exception not a silent return?

Drupal.Nodejs.connect = function () {
  var scheme = Drupal.settings.nodejs.client.secure ? 'https' : 'http',
      url = scheme + '://' + Drupal.settings.nodejs.client.host + ':' + Drupal.settings.nodejs.client.port;
  Drupal.settings.nodejs.connectTimeout = Drupal.settings.nodejs.connectTimeout || 5000;
  if (typeof io === 'undefined') {
     return false;
  }
  Drupal.Nodejs.socket = io.connect(url, {'connect timeout': Drupal.settings.nodejs.connectTimeout});
  Drupal.Nodejs.socket.on('connect', function() {

this appears to explain why the nodejs server has no clientsocket ids.

not sure how its meant to work? is this a global io object with no definition or declaration?

Syntapse’s picture

Issue summary: View changes
Syntapse’s picture

where is drupal getting its io object from? which socket.io is is referencing?

Syntapse’s picture

Status: Active » Closed (duplicate)
rlmumford’s picture

@laurencefass which issue is a duplicate of this?

rlmumford’s picture

Status: Closed (duplicate) » Needs work
Syntapse’s picture

Status: Needs work » Closed (outdated)