Ping.js 434 B

1234567891011121314151617181920
  1. var Sequence = require('./Sequence');
  2. var Util = require('util');
  3. var Packets = require('../packets');
  4. module.exports = Ping;
  5. Util.inherits(Ping, Sequence);
  6. function Ping(options, callback) {
  7. if (!callback && typeof options === 'function') {
  8. callback = options;
  9. options = {};
  10. }
  11. Sequence.call(this, options, callback);
  12. }
  13. Ping.prototype.start = function() {
  14. this.emit('packet', new Packets.ComPingPacket());
  15. };