Front end of the Slack clone application.

octet_parser.js 456B

123456789101112131415161718192021
  1. var EventEmitter = require('events').EventEmitter
  2. , util = require('util');
  3. function OctetParser(options){
  4. if(!(this instanceof OctetParser)) return new OctetParser(options);
  5. EventEmitter.call(this);
  6. }
  7. util.inherits(OctetParser, EventEmitter);
  8. exports.OctetParser = OctetParser;
  9. OctetParser.prototype.write = function(buffer) {
  10. this.emit('data', buffer);
  11. return buffer.length;
  12. };
  13. OctetParser.prototype.end = function() {
  14. this.emit('end');
  15. };