How to use the engine.io-parser.encodePacket function in engine

To help you get started, we’ve selected a few engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github physiii / open-automation / node_modules / engine.io / lib / transports / websocket.js View on Github external
packets.forEach(function(packet) {
    parser.encodePacket(packet, self.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, packet.options, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  });
};
github iamdjones / sublime-text-browser-sync / node_modules / browser-sync / node_modules / engine.io / lib / transports / websocket.js View on Github external
WebSocket.prototype.send = function (packets) {
  var self = this;
  for (var i = 0, l = packets.length; i < l; i++) {
    parser.encodePacket(packets[i], this.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  }
};
github socketstream / socketstream / node_modules / engine.io / lib / transports / websocket.js View on Github external
WebSocket.prototype.send = function (packets) {
  var self = this;
  for (var i = 0, l = packets.length; i < l; i++) {
    parser.encodePacket(packets[i], this.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  }
};
github booknds / sge / node_modules / browser-sync / node_modules / socket.io / node_modules / engine.io / lib / transports / websocket.js View on Github external
WebSocket.prototype.send = function (packets) {
  var self = this;
  for (var i = 0, l = packets.length; i < l; i++) {
    parser.encodePacket(packets[i], this.supportsBinary, function(data) {
      debug('writing "%s"', data);
      self.writable = false;
      self.socket.send(data, function (err){
        if (err) return self.onError('write error', err.stack);
        self.writable = true;
        self.emit('drain');
      });
    });
  }
};
github wearefractal / pulsar / pulsar.js View on Github external
WS.prototype.write = function(packets){
  for (var i = 0, l = packets.length; i < l; i++) {
    this.socket.send(parser.encodePacket(packets[i]));
  }
};

engine

Template engine based on Lo-Dash template, but adds features like the ability to register helpers and more easily set data to be used as context in templates.

MIT
Latest version published 6 years ago

Package Health Score

51 / 100
Full package analysis