quit.js 560 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. const Command = require('./command');
  3. /**
  4. * Quit (close connection)
  5. * see https://mariadb.com/kb/en/library/com_quit/
  6. */
  7. class Quit extends Command {
  8. constructor(resolve, reject) {
  9. super(resolve, reject);
  10. }
  11. start(out, opts, info) {
  12. out.startPacket(this);
  13. out.writeInt8(0x01);
  14. out.flushBuffer(true);
  15. this.emit('send_end');
  16. this.successEnd();
  17. this.onPacketReceive = this.skipResults;
  18. }
  19. skipResults(packet, out, opts, info) {
  20. //deliberately empty, if server send answer
  21. }
  22. }
  23. module.exports = Quit;