How to use the bser.dumpToBuffer function in bser

To help you get started, we’ve selected a few bser 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 facebook / metro / react-packager / src / SocketInterface / SocketServer.js View on Github external
_reply(sock, id, type, data) {
    debug('request finished', type);

    try {
      data = toJSON(data);
    } catch (e) {
      console.error('SocketServer exception:', e);
    }

    sock.write(bser.dumpToBuffer({
      id,
      type,
      data,
    }));

    // Debounce the kill timer to make sure all the bytes are sent through
    // the socket and the client has time to fully finish and disconnect.
    this._dieEventually();
  }
github fengjundev / DoubanMovie-React-Native / node_modules / react-native / packager / react-packager / src / SocketInterface / SocketServer.js View on Github external
_reply(sock, id, type, data) {
    debug('request finished', type);

    data = toJSON(data);

    sock.write(bser.dumpToBuffer({
      id,
      type,
      data,
    }));

    // Debounce the kill timer to make sure all the bytes are sent through
    // the socket and the client has time to fully finish and disconnect.
    this._dieEventually();
    this._jobs--;
  }
github facebook / watchman / node / index.js View on Github external
Client.prototype.sendNextCommand = function() {
  if (this.currentCommand) {
    // There's a command pending response, don't send this new one yet
    return;
  }

  this.currentCommand = this.commands.shift();
  if (!this.currentCommand) {
    // No further commands are queued
    return;
  }

  this.socket.write(bser.dumpToBuffer(this.currentCommand.cmd));
}
github facebook / metro / react-packager / src / SocketInterface / SocketClient.js View on Github external
_send(message) {
    message.id = uid();
    this._sock.write(bser.dumpToBuffer(message));
    return new Promise((resolve, reject) => {
      this._resolvers[message.id] = {resolve, reject};
    });
  }
github fengjundev / DoubanMovie-React-Native / node_modules / react-native / packager / react-packager / src / SocketInterface / SocketClient.js View on Github external
_send(message) {
    message.id = uid();
    this._sock.write(bser.dumpToBuffer(message));
    return new Promise((resolve, reject) => {
      this._resolvers[message.id] = {resolve, reject};
    });
  }

bser

JavaScript implementation of the BSER Binary Serialization

MIT
Latest version published 5 years ago

Package Health Score

88 / 100
Full package analysis

Popular bser functions