Ping.js 434 B

12345678910111213141516171819
  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. };